We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12864
    • 3 Posts
    Quote from: sottwell at Sep 06, 2010, 05:40 PM

    http://rtfm.modx.com/display/revolution20/Internationalization

    Thanks for the link. I had seen that page before and somehow thought it was only talking about applying i18n to small bits of text (site titles, navigation, footers, etc.), maybe because when the PHP developer in me reads the word "string" that’s what I think of, as opposed to larger "blobs" of info.

    So to be clear, would I be correct to understand that even a long article text (the page’s "Resource Content" in modX 1.x) can be handled using the lexicon functionality described on the page you linked to?
    • I have no idea; I don’t do Revo. But I’m sure the Revo people will be able to answer your questions.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 12236
        • 48 Posts
        Digital Butter - MODX Premiere Partners Reply #113, 13 years, 7 months ago
        Quote from: incipient at Sep 10, 2010, 02:19 PM

        Quote from: sottwell at Sep 06, 2010, 05:40 PM

        http://rtfm.modx.com/display/revolution20/Internationalization

        Thanks for the link. I had seen that page before and somehow thought it was only talking about applying i18n to small bits of text (site titles, navigation, footers, etc.), maybe because when the PHP developer in me reads the word "string" that’s what I think of, as opposed to larger "blobs" of info.

        So to be clear, would I be correct to understand that even a long article text (the page’s "Resource Content" in modX 1.x) can be handled using the lexicon functionality described on the page you linked to?

        That’s not really what you’d do (although I’m sure it could be made to work, but would become unwieldy super quick). Check out this thread for best practices for multi-lingual revo sites: http://modxcms.com/forums/index.php/topic,52869.msg306924.html
          • 2182
          • 11 Posts
          Hey, thanks a lot for this, what a great solution! I got everything working properly, but I just noticed that if I go to a page that doesn’t exist in another language and then switch the language, I will end up in the container page (e.g. Finnish/English, depending on the language) instead of the actual home page of that language. Any ideas how to fix this? I’d really appreciate any advice.
            • 9738
            • 21 Posts
            Quote from: arto at Oct 12, 2010, 12:22 PM

            Hey, thanks a lot for this, what a great solution! I got everything working properly, but I just noticed that if I go to a page that doesn’t exist in another language and then switch the language, I will end up in the container page (e.g. Finnish/English, depending on the language) instead of the actual home page of that language. Any ideas how to fix this? I’d really appreciate any advice.

            I think the easiest solution is to either make the language container itself the homepage or otherwise use a simple snippet to redirect to your homepage.

            For example I did this recently and had a template for language container, within that template was simply a call to FirstChildredirect http://modxcms.com/extras/package/151
              • 2182
              • 11 Posts
              Quote from: Fishcake at Oct 12, 2010, 01:02 PM

              Quote from: arto at Oct 12, 2010, 12:22 PM

              Hey, thanks a lot for this, what a great solution! I got everything working properly, but I just noticed that if I go to a page that doesn’t exist in another language and then switch the language, I will end up in the container page (e.g. Finnish/English, depending on the language) instead of the actual home page of that language. Any ideas how to fix this? I’d really appreciate any advice.

              I think the easiest solution is to either make the language container itself the homepage or otherwise use a simple snippet to redirect to your homepage.

              For example I did this recently and had a template for language container, within that template was simply a call to FirstChildredirect http://modxcms.com/extras/package/151

              Beautiful, thanks! This works just like I wanted. I was sure there would be a solution hidden somewhere within the language changer code itself, but I guess this is the way to go. Oh, and I can’t really make the language container the homepage, as it would then show in the main menu as English instead of Home... unless I’m missing something. But anyway, everything is great now. smiley

              By the way, in case anyone is wondering how to make the containers not to show in breadcrumbs, you can just ignore the ids you want to exclude:

              [[Breadcrumbs? &ignoreIds=`49,55,77`]]
                • 2940
                • 17 Posts
                @arto thanks for the tip! saved my time!
                  • 2320
                  • 47 Posts
                  Hi everybody,
                  I’m trying to use a different css depending on the language and use something like [current-language]-style.css but seems that I can’t do that. I might doing the wrong thing though. Do you know how I can get the 2 letters country code?
                  Thank you so much.
                    • 9738
                    • 21 Posts
                    Quote from: asthyanax at Nov 16, 2010, 09:30 PM

                    Hi everybody,
                    I’m trying to use a different css depending on the language and use something like [current-language]-style.css but seems that I can’t do that. I might doing the wrong thing though. Do you know how I can get the 2 letters country code?
                    Thank you so much.

                    It should be as simple as including something like [+Language+]-style.css in your template/chunk.
                      • 10481
                      • 9 Posts
                      How would you modify the code if you wish all the languages to appear in the chooser except for the displayed one?

                      edit: found answer...

                      in the "language" snippet, add the following line after << setcookie("LanguageID",$up ... >>
                      $_COOKIE['LanguageID'] = $up;

                      this way we can use the new value assigned to the cookie without a page reload.

                      In the "LanguageChooser" snippet, add the following to the array:
                      "excludeDocs"=>$_COOKIE['LanguageID']