GithubHelp home page GithubHelp logo

Comments (4)

BlackbitDevs avatar BlackbitDevs commented on May 27, 2024 1

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.

solverat avatar solverat commented on May 27, 2024

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.

BlackbitDevs avatar BlackbitDevs commented on May 27, 2024

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.

solverat avatar solverat commented on May 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.