We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28042 ☆ A M B ☆
    • 24,524 Posts
    Hm. The client that I set that up for has decided to run his site himself, and has blocked my manager access, so I can't just go look at it. All I know is, I followed that tutorial exactly, using that plugin, and it worked. Are you sure you have the context settings for both web and ar contexts set up correctly? I had three, web (fr), en, and he. You can at least see it in action here http://whitecityartgallery.com/
      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
      • 3866 ☆ A M B ☆
      • 350 Posts
      Hi Susan, I think perhaps we're misunderstanding each other. I have got the multi lingual site working with my english version rendering with just a forward slash and then toggles to /ar/, the issue that arose probably is something with the .htaccess as it would seem that any alias which starts 'en' lookings like the 'en' in the .htaccess and redirects to error because I haven't set it up with /en/.

      I followed the tutorials http://designfromwithin.com/blog-webdesign-development/2012/01/12/modx-multilingual-setting-up-babel-and-have-a-website-with-multible-languages/ and www.butter.com.hk/blog/posts/2010/08/internationalization-in-modx-revolution.html along side the one on the Babel site http://www.multilingual-modx.com/blog/2011/multilingual-websites-with-modx-and-babel.html.

      Just to clarify, are you using the LangRouter in preference to the suggested gateway plugin? And did you not make any changes to your .htaccess at all?

      Thanks for help - and the site you built works great.
        Helen Warner
        Number one pixel!
        Proud to be linked with MODX at Crimson Pixel
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        That LangRouter plugin doesn't require any changes to the default .htaccess rewrite rules; it uses onPageNotFound to re-route to the proper URL instead of .htaccess rewrites.
          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
          • 3866 ☆ A M B ☆
          • 350 Posts
          Quote from: sottwell at Apr 13, 2013, 09:26 PM
          That LangRouter plugin doesn't require any changes to the default .htaccess rewrite rules; it uses onPageNotFound to re-route to the proper URL instead of .htaccess rewrites.

          Does the OnPageNotFound need to be selected in the System Events as there isn't any instructions to that effect? Or is that the created when you set the following?

          4. Add new system setting `babel.contextDefault` and set it to the default
          * context, which should be served when no language is specified in
          * request, eg. `pl`.

          Just trying to clarify this in my head smiley
            Helen Warner
            Number one pixel!
            Proud to be linked with MODX at Crimson Pixel
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            No, I did not remember correctly. It's the OnHandleRequest event; this is mentioned in step 4 of the tutorial article. This is replacement plugin mentioned in the comment from gadamiak.

            4. Create a gateway plugin which listens to the "OnHandleRequest" event to load the correct context.
              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
              • 3866 ☆ A M B ☆
              • 350 Posts
              Ok, I understand you've replaced the gateway plugin in the Babel tutorial with the LangRouter plugin and indeed in the Babel tutorial it does does state:

              Create a gateway plugin which listens to the "OnHandleRequest" event to load the correct context.

              which I had applied to the original plugin I had used which was the one in the tutorial, but having read the instructions at the top of the LangRouter I missed this particular requirement. Will see how I get on now wink

              Perseverance will pay off...
                Helen Warner
                Number one pixel!
                Proud to be linked with MODX at Crimson Pixel
                • 3866 ☆ A M B ☆
                • 350 Posts
                Hi Susan, couldn't get the LangRouter to work, so ended up having to go with configuring .htaccess and using the gateway plugin that is used in the Babel tutorial. All works fine. I think the issue I had was the fact that I had not specified /en/ in my context setting, so any resources which started with en was causing an error. Now that the site is domain.com/en/ or domain.com/ar/ works just fine.

                Thanks for your help though.
                  Helen Warner
                  Number one pixel!
                  Proud to be linked with MODX at Crimson Pixel