Comments (4)
Works like a charm! Thank you very much!
I will update the example doc in https://github.com/dachcom-digital/pimcore-i18n/blob/master/docs/20_Zones.md so others do not run into the same problem.
from pimcore-i18n.
Hey @BlackbitNeueMedien. In fact, you don't need to configure zones. They are only required if you're using multiple sites which are connected.
In your case, this should be enough:
i18n:
mode: language
locale_adapter: system
Also, don't forget to connect (en
and de
) and (en/123
and de/123
) with the localization tool.
from pimcore-i18n.
In fact I have multiple sites. Without any further zone configuration getActiveLanguages()
delivered 3 times "DE".
The whole document structure looks like this:
domain.de
-- ...
example.org
-- de
---- 123
-- en
---- 123
other-domain.com
-- ...
I linked de and en as well as de/123 and en/123 with the localization tool.
When I call example.org/de I want getActiveLanguages()
to return example.org/de (as active language) and example.org/en - but not other-domain.com nor domain.de.
from pimcore-i18n.
Perfect.
Pre-Config
Be sure that the site document example.org
has no defined language (Document => "Navigation & Settings" => "Language" Dropdown: Select empty and save)
Configuration Example:
i18n:
mode: language
locale_adapter: system
registry:
redirector:
cookie:
enabled: false
zones:
zone1:
id: 1
name: 'domain_de'
domains:
- 'domain.de'
config:
mode: language
locale_adapter: system
translations: ~
zone2:
id: 2
name: 'example_org'
domains:
- 'example.org'
config:
mode: language
locale_adapter: system
translations: ~
zone3:
id: 3
name: 'other_domain_com'
domains:
- 'other-domain.com'
config:
mode: language
locale_adapter: system
translations: ~
View
<div class="languages">
<ul>
{% for language in i18n_context('getActiveLanguages') %}
<li><a href="{{ language.linkedHref }}">{{ language.iso }}</a></li>
{% endfor %}
</ul>
</div>
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.