We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42503
    • 120 Posts
    Hi,
    I have the requirement to create a multi lingual site. My main language is France and other language is English.
    I have used Babel to create this.
    I have followed the below tutorial
    http://designfromwithin.com/blog-webdesign-development/2012/01/12/modx-multilingual-setting-up-babel-and-have-a-website-with-multible-languages/

    Now my main problem is only the France link is showing up, but the English link is not showing up.

    I have another question. When converting the France content to English. If it will automatically convert the content or I have to manually put the English content.

    URL: aailabs.com/ens

    Please help.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Using contexts and Babel requires a resource for each language, one in each language context. You need to provide the content for each resource, in each language. All that Babel does is provide links between the resources in the different contexts to make it easier to manage them. The rest is provided by snippets and plugins to determine which resource to serve, and to help in generating menus. You'll also probably needs some custom lexicon files for form prompts and other small bits of content.

      Here's another tutorial that may help you to understand how it all works together. http://www.multilingual-modx.com/blog/2011/seo-friendly-multilingual-websites-with-modx-and-babel.html

      I prefer to use the router plugin from here https://gist.github.com/gadamiak/3812853 (it is mentioned in the comments to the article above).
        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
        • 42503
        • 120 Posts
        Hi Sottwell,
        Still no success. I tried the steps in the tutorial. Also created the router plugins. But still no success. Please help I got fully stucked.

        Quote from: sottwell at Dec 13, 2013, 02:39 AM
        Using contexts and Babel requires a resource for each language, one in each language context. You need to provide the content for each resource, in each language. All that Babel does is provide links between the resources in the different contexts to make it easier to manage them. The rest is provided by snippets and plugins to determine which resource to serve, and to help in generating menus. You'll also probably needs some custom lexicon files for form prompts and other small bits of content.

        Here's another tutorial that may help you to understand how it all works together. http://www.multilingual-modx.com/blog/2011/seo-friendly-multilingual-websites-with-modx-and-babel.html

        I prefer to use the router plugin from here https://gist.github.com/gadamiak/3812853 (it is mentioned in the comments to the article above).
          • 46022
          • 2 Posts
          Hello you two,

          i'm also in the process of getting babel to work for modx revo 2.2.10. With little success so far. Put 1 and a half day into it so far.
          I hope its ok to add to this thread instead of opening a new one.

          - I followed the tutorials of the author at http://www.multilingual-modx.com/ to set things up.
          - tried to setup a (de|en) site, where de is default(web).

          Results:
          - links like http://www.host.de/sub_folder/de/start are working
          - links like http://www.host.de/sub_folder/en/home are not. Responce: 503 Error Page not found

          - The view button in the window of a resource(en/home) just points to: http://www.host.de/sub_folder

          - The Wayfinder generates links without the de, en folders. So everything is http://www.host.de/sub_folder/path

          - The Language Switcher provided by babel through <ul>[[BabelLinks]]</ul> just generates links without the language folders like this: http://www.host.de/sub_folder

          Hope you can point out the mistakes i made or where to debug next.

          All the best
          Jens




          Details:
          - adjusted my .htaccess file. The rewrite is working. rewrite 'de/start' -> 'index.php?cultureKey=de&q=start'
          - i added the context specific settings, like so:



          - made the changes to user friendly urls in Systemsettings


          - my router plugin, so far



          - installed babel 2.2.5 via modx packet manager
            • 42503
            • 120 Posts
            Hi Carpediem,
            I have over come the missing link part. Now I have started using babel call uncache. Facing the same problem In the converted language page I am also getting 404 error.

            Some body please help, from past one week I am this trouble. I have tried various thing but nothing is working for me.
            Quote from: carpediem at Dec 16, 2013, 09:51 AM
            Hello you two,

            i'm also in the process of getting babel to work for modx revo 2.2.10. With little success so far. Put 1 and a half day into it so far.
            I hope its ok to add to this thread instead of opening a new one.

            - I followed the tutorials of the author at http://www.multilingual-modx.com/ to set things up.
            - tried to setup a (de|en) site, where de is default(web).

            Results:
            - links like http://www.host.de/sub_folder/de/start are working
            - links like http://www.host.de/sub_folder/en/home are not. Responce: 503 Error Page not found

            - The view button in the window of a resource(en/home) just points to: http://www.host.de/sub_folder

            - The Wayfinder generates links without the de, en folders. So everything is http://www.host.de/sub_folder/path

            - The Language Switcher provided by babel through <ul>[[BabelLinks]]</ul> just generates links without the language folders like this: http://www.host.de/sub_folder

            Hope you can point out the mistakes i made or where to debug next.

            All the best
            Jens




            Details:
            - adjusted my .htaccess file. The rewrite is working. rewrite 'de/start' -> 'index.php?cultureKey=de&q=start'
            - i added the context specific settings, like so:



            - made the changes to user friendly urls in Systemsettings


            - my router plugin, so far



            - installed babel 2.2.5 via modx packet manager
              • 46022
              • 2 Posts
              Hey,

              congrats for finding a solution to the link problem. Please share it with the rest of us. smiley
                • 44661
                • 31 Posts
                Hello,
                I am using Babel with this simple plugin added and named getaway :

                <?php
                if($modx->context->get('key') != "mgr"){
                    /* grab the current langauge from the cultureKey request var */
                    switch ($_REQUEST['cultureKey']) {
                        case 'de':
                            /* switch the context */
                            $modx->switchContext('de');
                            break;
                        case 'fr':
                            /* switch the context */
                            $modx->switchContext('fr');
                            break;
                        case 'es':
                            /* switch the context */
                            $modx->switchContext('es');
                            break;
                        default:
                            /* Set the default context here */
                            $modx->switchContext('web');
                            break;
                    }
                    /* unset GET var to avoid
                     * appending cultureKey=xy to URLs by other components */
                    unset($_GET['cultureKey']);
                }


                default context (web) in english

                you need to add redirections to the main htaccess for the FURLS (Friendly URLs) :

                RewriteCond %{REQUEST_FILENAME} !-d
                RewriteCond %{REQUEST_FILENAME} !-f
                RewriteRule ^(de|fr|es)/favicon.ico$ favicon.ico [L,QSA]
                   
                RewriteCond %{REQUEST_FILENAME} !-d
                RewriteCond %{REQUEST_FILENAME} !-f
                RewriteRule ^(de|fr|es)/assets(.*)$ assets$2 [L,QSA]
                  
                # redirect all other requests to /de|fr|es/* 
                # to index.php and set the cultureKey parameter
                RewriteCond %{REQUEST_FILENAME} !-f
                RewriteCond %{REQUEST_FILENAME} !-d
                RewriteRule ^(de|fr|es)?/?(.*)$ index.php?cultureKey=$1&q=$2 [L,QSA]


                ... works just fine !
                  • 42503
                  • 120 Posts
                  I simply used the uncache link to call the babel link. Previously it was not working but still the things remain same, still I am getting 404 error.Quote from: carpediem at Dec 16, 2013, 11:58 AM
                  Hey,

                  congrats for finding a solution to the link problem. Please share it with the rest of us. smiley
                    • 42503
                    • 120 Posts
                    Hi Justinet,
                    I have tried all type combination but it is not working.

                    Please check my gateway plugins and htaccess code.
                    Gateway plugins
                    <?php
                    if($modx->context->get('key') != "mgr"){
                                    /* grab the current langauge from the cultureKey request var */
                                    switch ($_REQUEST['cultureKey']) {
                                        case 'en':
                                            /* switch the context */
                                            $modx->switchContext('en');
                                            break;
                                        default:
                                            /* Set the default context here */
                                            $modx->switchContext('web');
                                            break;
                                    }
                                    /* unset GET var to avoid
                                     * appending cultureKey=xy to URLs by other components */
                                    unset($_GET['cultureKey']);
                                }


                    htaccess code
                    RewriteEngine On
                    RewriteBase /ens
                    
                    # redirect all requests to /de/favicon.ico and /nl/favicon.ico
                    # to /favicon.ico
                    RewriteCond %{REQUEST_FILENAME} !-d
                    RewriteCond %{REQUEST_FILENAME} !-f
                    RewriteRule ^(en)/favicon.ico$ favicon.ico [L,QSA]
                       
                    # redirect all requests to /de/assets* and /nl/assets* to /assets*
                    RewriteCond %{REQUEST_FILENAME} !-d
                    RewriteCond %{REQUEST_FILENAME} !-f
                    RewriteRule ^(en)/assets(.*)$ assets$2 [L,QSA]
                      
                    # redirect all other requests to /de/* and /nl/*
                    # to index.php and set the cultureKey parameter
                    RewriteCond %{REQUEST_FILENAME} !-f
                    RewriteCond %{REQUEST_FILENAME} !-d
                    RewriteRule ^(en)?/?(.*)$ index.php?cultureKey=$1&q=$2 [L,QSA]


                    Can you please check where I am making the mistake.

                    Quote from: justinet at Dec 16, 2013, 01:42 PM
                    Hello,
                    I am using Babel with this simple plugin added and named getaway :

                    <!--?php
                    if($modx--->context->get('key') != "mgr"){
                        /* grab the current langauge from the cultureKey request var */
                        switch ($_REQUEST['cultureKey']) {
                            case 'de':
                                /* switch the context */
                                $modx->switchContext('de');
                                break;
                            case 'fr':
                                /* switch the context */
                                $modx->switchContext('fr');
                                break;
                            case 'es':
                                /* switch the context */
                                $modx->switchContext('es');
                                break;
                            default:
                                /* Set the default context here */
                                $modx->switchContext('web');
                                break;
                        }
                        /* unset GET var to avoid
                         * appending cultureKey=xy to URLs by other components */
                        unset($_GET['cultureKey']);
                    }


                    default context (web) in english

                    you need to add redirections to the main htaccess for the FURLS (Friendly URLs) :

                    RewriteCond %{REQUEST_FILENAME} !-d
                    RewriteCond %{REQUEST_FILENAME} !-f
                    RewriteRule ^(de|fr|es)/favicon.ico$ favicon.ico [L,QSA]
                       
                    RewriteCond %{REQUEST_FILENAME} !-d
                    RewriteCond %{REQUEST_FILENAME} !-f
                    RewriteRule ^(de|fr|es)/assets(.*)$ assets$2 [L,QSA]
                      
                    # redirect all other requests to /de|fr|es/* 
                    # to index.php and set the cultureKey parameter
                    RewriteCond %{REQUEST_FILENAME} !-f
                    RewriteCond %{REQUEST_FILENAME} !-d
                    RewriteRule ^(de|fr|es)?/?(.*)$ index.php?cultureKey=$1&q=$2 [L,QSA]


                    ... works just fine !
                      • 42503
                      • 120 Posts
                      Can any body put any solution.