Comments (5)
Good catch, I just pushed the correct examples. In your third example, the object_id: 123 would be ignored, since the entity property is stronger in i18n_create_context_by_entity
which will then call the corresponding link generator!
from pimcore-i18n.
A twig helper would be the better way. Good one!
from pimcore-i18n.
I spent way too much time on this :). But now, this is possible on dev-master.
In case you're still interested: https://github.com/dachcom-digital/pimcore-i18n/blob/master/docs/21_CustomI18nContextLookUp.md
We refactored the complete I18n bootstrap for this, but I think it was worth the time. The workflow is much cleaner now.
Would love to hear some feedback before we're going to tag this.
from pimcore-i18n.
Love it!
The only thing I am wondering about:
{% set object_context = i18n_create_context_by_entity(pimcore_object(16), { _locale: 'en', object_id: 16 }) %}
Is there a difference to
{% set object_context = i18n_create_context_by_entity(pimcore_object(16), { _locale: 'en' }) %}
?
Or the other way around, what happens when doing
{% set object_context = i18n_create_context_by_entity(pimcore_object(16), { _locale: 'en', object_id: 123 }) %}
from pimcore-i18n.
Ok, sounds good to me. Big thanks for the effort!
from pimcore-i18n.
Related Issues (20)
- Wrong locale in static routes
- I18nContext is missing if fallback document is an instance of Document\Link
- exception rendering error page
- Missing site when generating alternate links
- Zone Settings: Use fallback for translations
- Allow parameters for translation config
- Single domain setup with multiple locales HOT 4
- [LinkGenerator] Improve requirements for AbstractRequestAwareLinkGenerator HOT 1
- Context in snippets HOT 1
- Relay main requests in sub requests HOT 1
- Resolve areabrick-render-index-editmode
- Set <meta name="robots" content="noindex"> on redirect from maindomain to language context
- active language is ambiguous HOT 1
- FeatureREQ | i18n_localized_target_object
- configurable cookie lifetime
- Href Lang Tags with Multisites
- Disabling CookieRedirector throws Exception HOT 2
- Exception thrown during profiler rendering HOT 1
- Should x-default and alternate links be pushed via HTTP2? HOT 7
- geoCountry not in decision when no user laguage matched
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pimcore-i18n.