We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3186 ☆ A M B ☆
    • 279 Posts
    Hi all,

    I’m a little bit new to MODx but I realy love it!

    For a customer I build the new website in MODx-Revo 2.0.3 and I want to know how I can load different language lexicon entries. My resource-structure is like this simple setup;

    English (en)
    -- Home
    -- Contact
    Dutch (nl)
    -- Home
    -- Contact

    I have everything like the menu etc. already done but now I want to use the Login snippets also but the lexicon entries needs to be changed when I switched from English to Dutch (for example). The Login lexicon entries for Dutch do I have translated but I don’t know how I could load the right lexicon set.

    I also made a little snippet wich finds the language parent and figures out the alias (= language code) for the pages. This snippet will be called by a plugin, onWebPagePrerender. But next? I don’t know! I’ve tried something with the ’cultureKey’ but he’s caching the lexicon entries so on English it could be Dutch and vice versa

    Could anyone help me a little bit more?

    Regards, Bert
      MODX Ambassador (NL) & Professional MODX developer
      Follow me on Twitter | Visit my page on Facebook | View my code on Github | View my script posts
      MODX e-commerce solution SimpleCart
      • 28215
      • 4,149 Posts
      splittingred Reply #2, 16 years ago
      All you need to do is add the ’cultureKey’ Context Setting for each context and set it to the IANA country code you want to load, eg: ’en’ or ’nl’ or ’de’. The scripts should handle the rest.
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 3186 ☆ A M B ☆
        • 279 Posts
        Okay, but I have just one context..
          MODX Ambassador (NL) & Professional MODX developer
          Follow me on Twitter | Visit my page on Facebook | View my code on Github | View my script posts
          MODX e-commerce solution SimpleCart