We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8668
    • 8 Posts
    Another multilingual solution for modx 0963, it is supposed to overcome the shortcomings of the other solutions.

    MLx is a set of Snippets to allow one to build multilingual sites on modx:
    - find best translation possible for an article,
    - produce links to translations,
    - output chunk or text based on current language (for translation of interface elements).

    to download the latest version : http://modxcms.com/MLx-Multi-Language-eXtension-2354.html

    Here’s how it works:
    To make a multilingual website using the actual modx version (0963), we will :
    - build distinct hierarchies of articles (trees) for each language, where the root of each language tree will be an article representing the language itself (alias set to language-code);
    - have a reference language tree, whose root is known as the reference language root;
    - for any article that it is not in the reference language tree, we may add a pointer (using a ’reference_page’ template variable) to a reference article in the reference tree.
    - install the 3 MLx snippets.

    This process builds a set of language trees, where some articles (not necessarily all) point to reference articles in the reference language tree.
    Based on this, the MLx system will then try for an article A to find the best translation in every language, that is:
    - find a best reference article for article A :
    - if A points to article B in reference article tree, then it’s B, else go up to parent article of A to find a pointer to the reference tree, and further up if needed...
    - find a best translation based on best reference article in every other language (similarly).

    The MLx solution has the following advantages:
    + url path is in correct language
    + each language may have some structural variations (not each article ought to be translated)

      • 7231
      • 4,205 Posts
      THis looks very interesting. I will need to look at this a little deeper when I have more time. Thanks grin
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don't know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 21000
        • 11 Posts
        Hello,

        A little bug...
        In the file MLxLangChooser.php
        $tpl   = isset($tpl) ? $tpl : 'MLxLangChooserTpl';


        should be replaced by
        $tpl   = isset($tpl) ? $tpl : 'LanguageChooserItemTpl';


        (or the default chunk must be called MLxLangChooserTpl)

        Am I Wrong?

        Best regards.
          • 21000
          • 11 Posts
          Hi,

          Another bug:
          The title of the original page is missing in the language chooser when we are in another language because of this on line 87

          $aresults[] = array("contentid" => $vId);


          On the next loop, $aresults is taken and the pagetitle is not set...

          Regards
            • 2631
            • 1 Posts
            Hi,

            The doc for this extension is not saying enough, I don’t actually get it, and would appreciate some help clarifying things if at all possible? Note that I’m a MODx newbie too...

            Note: I performed all install steps as documented in "readme.txt".

            Specific questions:
            1- Currently, my MODx install displays ALL the root documents on the web. Does the MLx extension provide a way to hide the other root documents, i.e. only display the one for the selected language?

            2- How?

            3- The "readme.txt" file says, under "Usage": "choose among theem a reference language (e.g. ’en, with id = ’1’)". How do I do that??

            4- Where does the "[!MLx!]" go? I placed it in the "<head>" of my Template, but that doesn’t do much at runtime.

            5- How do I get the links to the various language pages? --> I added this too to my template body, and it doesn’t do anything: "[+mlx:lang:code+] [+mlx:url+]"

            6- Actual examples of the doc hierarchies would help (the readme examples don’t make sense to me), i.e; screenshot of doc hierarchy?

            Thanks in advance for your help.

            .b/\b.
              • 21000
              • 11 Posts
              hi

              Quote from: Babsy at Mar 26, 2009, 07:43 PM

              1- Currently, my MODx install displays ALL the root documents on the web. Does the MLx extension provide a way to hide the other root documents, i.e. only display the one for the selected language?
              2- How?

              You have to tell wayfinder to start at the language root level. Something like this should work
              [!Wayfinder? &startId=`[[UltimateParent]]` !]

              (ultimate parent will return the top parent of the document you are watching, and this shoud be the language root)

              Quote from: Babsy at Mar 26, 2009, 07:43 PM

              3- The "readme.txt" file says, under "Usage": "choose among theem a reference language (e.g. ’en, with id = ’1’)". How do I do that??
              This is the ID the reference language root (the number after the name of the page in the site tree)


              Quote from: Babsy at Mar 26, 2009, 07:43 PM

              4- Where does the "[!MLx!]" go? I placed it in the "<head>" of my Template, but that doesn’t do much at runtime.
              The very top of the template is a good place

              Quote from: Babsy at Mar 26, 2009, 07:43 PM

              5- How do I get the links to the various language pages? --> I added this too to my template body, and it doesn’t do anything: "[+mlx:lang:code+] [+mlx:url+]"

              try this...
              [!MLxLanguageChooser? &tpl=`MLxLangChooserTpl` &langs=`en,fr`!]


              good luck smiley
                • 18830
                • 161 Posts
                This seems to be a great snippet. But as soon as I call the MLx-Snippet I got this error massage:

                MODx encountered the following error while attempting to parse the requested resource:
                « `` is not numeric and may not be passed to makeUrl() »

                The site is bilingual - with "de" as reference language (the id of the folder is 1). I added a TV "reference_page" to any document (in both the german and the french folder but not for the language folders themselves). For any french doc I set the TV to "1". What ist going wrong?
                  • 8668
                  • 8 Posts
                  Quote from: Mazso at May 05, 2009, 01:13 PM

                  ... as soon as I call the MLx-Snippet I got this error massage:

                  MODx encountered the following error while attempting to parse the requested resource:
                  « `` is not numeric and may not be passed to makeUrl() »

                  The site is bilingual - with "de" as reference language (the id of the folder is 1). I added a TV "reference_page" to any document (in both the german and the french folder but not for the language folders themselves). For any french doc I set the TV to "1". What ist going wrong?

                  Well a couple of things:

                  • each article in the french tree should have reference_page value set to the id of the corresponding article in the german tree,
                  • the root french article should thus have reference_page set to 1, which is your root for german

                  Hope that will help. A new version (with minor updates) is coming, as soon as it is validated by modx extra managers.
                    • 18830
                    • 161 Posts
                    Thank you, electrogramme, no more error messages.

                    Bit may I ask you another question? When I use this snippet call

                    [!MLxLanguageChooser? &tpl=`LanguageChooserItemTpl`&langs=`de,fr` !]
                    


                    I get the link on the french pages to the according german pages. But on german pages the link points not to the appropriate french document but to the actual german doc. And there are always two "de"-Links. See the test site. Did I miss something?
                      • 8668
                      • 8 Posts
                      Well hard to answer what is set wrong... You could lend me access to the manager to see your settings, if possible. Otherwise I’d recommend you wait a few hours/days for the new version. contact me directly per email if you want it.

                      b.