We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36675
    • 56 Posts
    MODX Revo 2.1.3, MAMP 2.0.3, OSX 10.6.8


    Problem:instead of showing up as proper languages in babellink and the manager interface, I get links looking like: babel.language_xx. I have included a screenshot.


    Where do I change so that for example "babel.language_ja (japanese)" is parsed as "whatever i feel like (japanese)"?

    I have been struggling with configuring Babel for the last 24 hours or more, and finally got it functioning properly (knock on wood). This is the last piece smiley

    This question has been answered by okyanet. See the first response.

    [ed. note: jorgeca last edited this post 14 years, 11 months ago.]
      • 36675
      • 56 Posts
      Is it terribly rude of me to bump this?

      Its Friday, so I am forgiven, right?
      • discuss.answer
        • 33968
        • 863 Posts
        All forgiven!

        You need to add it to the Babel lexicon files:

        - Browse to core/components/babel/lexicon/
        - Go to /en/default.inc.php and open in your code editor
        - Add the following string under the other language names

        $_lang['babel.language_ja'] = 'Japanese';


        If you have Japanese manager users you will have to create new lexicon files for Japanese as they don't appear to be included in Babel. Just duplicate the /en/ folder and rename to /ja/, then translate all the strings within default.inc.php and properties.inc.php to Japanese.

        Then repeat for Chinese /zh/ and Arabic /ar/ smiley


        Note you can also edit language strings from within the manager - System > Lexicon Management
          • 36675
          • 56 Posts
          Brilliant! Thanks man. No idea how long I would have spent trying to figure that one out.

          I guess my next question is: how do I have babel.language_xx follow the manager-language when in the manager, but stay static in the front-end links.

          I.e. have all the language-links in Japanese when my client's Japanese-speaking employees are editing the site, in English when the English-speaking employees are editing, and still keep the links in their respective languages when the web-users/visitors are browsing the website.

          Like this:
          English | 日本語 | 中文 | عربية [ed. note: jorgeca last edited this post 14 years, 11 months ago.]
            • 36675
            • 56 Posts
            Quote from: jorgeca at Oct 10, 2011, 09:39 PM

            I guess my next question is: how do I have babel.language_xx follow the manager-language when in the manager, but stay static in the front-end links.

            Like this:
            English | 日本語 | 中文 | عربية

            Thanks to the help from Lucas earlier, I was able to solve this secondary problem as well.

            A simple way to get static languages in the language menu, is by adding the following to the template for calling the BabelLinks snipppet:
            &language=`[[+cultureKey]]`

            Now it looks like:
            [[%babel.language_[[+cultureKey]]? &topic=`default` &namespace=`babel` &language=`[[+cultureKey]]`]]


            And the end product looks something like this: English | 日本語 | 中文 | عربية

            I guess the next question is how to get BabelLinks to call flags. I have a feeling the class call in the BabelLinks template I am using must be changed for that to work. [ed. note: jorgeca last edited this post 14 years, 11 months ago.]
              • 12410
              • 353 Posts
              Hi Guys,
              Exploring Babel and have 3 languages working ie en,de,fr.

              Using this http://designfromwithin.com/blog/995/modx-multilingual-setting-up-babel/ as my guide. How do I add eg Arabic (ar)

              I see in core/components/babel/lexicon/

              ....en/default.inc.php


              /* language names */
              $_lang['babel.language_de'] = 'German';
              $_lang['babel.language_en'] = 'English';
              $_lang['babel.language_es'] = 'Spanish';
              $_lang['babel.language_fr'] = 'French';
              $_lang['babel.language_nl'] = 'Dutch';
              $_lang['babel.language_ru'] = 'Russian';



              that babel is restricted to 6 languages so how do i add more eg Arabic? I also see that the folders en,de and fr were created in core/components/babel/lexicon/ during the process of setting up babel contexts as per tutorial above. How would ar folder get generated.

              If anyone has the how to for adding languages I would love to see it.

              Thanks

              PS I added $_lang['babel.language_ar'] = 'Arabic'; to above file, also added it via system>lexicon management under babel like the others and tried to create a folder called ar at core/components/babel/lexicon/ but permission issues block me from duplicating folders - can't change chmod from 550 to 777. The arabic translation (grey box) just doesnt appear when i edit resources. en,fr and de work fine. Contexts for Arabic are fine too and htaccess and gateway snippet looks fine to cater for ar
              Thanks
                • 33968
                • 863 Posts
                See my response above for how to add a new language.

                If you're unable to change folder permissions you could duplicate the file on your local machine then upload to that folder?
                  • 12410
                  • 353 Posts
                  Hi,
                  Thanks for getting back. I reinstalled babel and it pulls in the Arabic now. Possibly a bug. I tried uploading the files via Filezilla and my hosting a/c file manager but permission denied to create the ar folder and/or files. Trying to change chmod from 550 to 755/777 was disallowed. Hmmm - head scratcher. I made some progress anyway smiley
                  Thanks

                  SOLVED kinda - created the folder via the modx cp under files, added php file extension as an allowable file type for uploading under system settings and uploaded both php files and amended them within modx. [ed. note: howster last edited this post 14 years, 10 months ago.]
                    • 12410
                    • 353 Posts
                    When I create a new language should i be flushing permissions and clearing the site cache each time? This may have caused the bug for me.
                    Thanks
                      • 33968
                      • 863 Posts
                      Lexicons are all cached so yes you should be clearing the cache when you do an update there.