We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30086
    • 110 Posts
    Hi guys
    I’m very new to modx and i would like to integrate this Multilanguage in my website.
    I found a tutorial on this site and follow this one:

    http://wiki.modxcms.com/index.php/Make_Multi_Lingual_Site

    But I have some questions: Here it stated that:
    "For each page on your site you need to specify which is the translated page. This is achieved using the languages template variable. The format of the template variable value is:...two_letter_iso_country_code=document_id,two_letter_iso_country_code=document_id  "


    where should i do this?

    This is the structure of my site:
    http://tinypic.com/r/nbps2h/7
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Create a TV for this; name it whatever you like. Assign it the template(s) it will be needed on. Then for each resource, edit the TV like this:
      de=23,fr=52

      The first part is for the language, the number is the corresponding resource ID.

      This example will generate a link on each page for its German and French equivalent.

      If you don’t want to have links in every page for their equivalent pages in the other languages, you can skip that part.
        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
        • 30086
        • 110 Posts
        Do I have to create a Template variable in every resource?

        I created one Template Variable according to the instructions in the website already and I named it "Languages"


        This one:
        de=23,fr=52
        I put it in every resource for example I wrote it in the "EN", "DE", and "FR"

        Am I not in the same page?

        Thanks
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          You are correct; create one TV named "Languages". Now edit that TV in each resource in the manner described. It needs a comma-separated list of the language code = that language’s resource ID. For example, if you are working on the English page (ID 24) and the German page is ID 42, you would put de=42, then on the German page you would have en=24.

          Then the [!Languages!] snippet is placed in your template where you want the links to the other languages to appear in each page. It will get the list of language/resource ID from the TV and generate the links.
            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
            • 30086
            • 110 Posts
            how can I edit the TV in each resource.
            This is how my TV looks like

            http://www.freeimagehosting.net/image.php?44856b5fc6.png

            And this is under "EN"

            Do I need to create another TV for german and french?

              • 28042 ☆ A M B ☆
              • 24,524 Posts
              No. One TV will do the job. Make sure you check the boxes for the templates your resources use when you create the TV. Then when you edit a resource (page), under the main content section you’ll see the TV field.

              http://sottwell.com/how-template-variables-work.html
                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
                • 30086
                • 110 Posts
                thanks.
                does that mean I have to type this

                de=23,fr=52


                in the Languages under Template Variables in every resource?
                is that correct?
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  For every resource, you’ll need to enter the corresponding language/resource ID for the page in the other languages.
                    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
                    • 30086
                    • 110 Posts
                    ok i did it, but i get an error like this:


                    « MODx Parse Error »
                    MODx encountered the following error while attempting to parse the requested resource:
                    « ``2`]]` is not numeric and may not be passed to makeUrl() »
                     
                    Parser timing
                      MySQL: 	0.0049 s	(5 Requests)
                      PHP: 	0.0238 s	 
                      Total: 	0.0288 s	 



                    in the "EN" Resource this is what I wrote: Is this correct?

                    [[Redirect?id=`2`]]
                      • 30086
                      • 110 Posts
                      i changed the
                      [[Redirect?id=`2`]]


                      to:
                      de=11, fr=6


                      then i saw the flags on the lower left side of the site, but i only have the flag of german and french.
                      and if i click on any of these flags, then the word "English" will appear.

                      and the 2 flags will disappear.

                      i don’t understand that i only have 2 flags on the main site...
                      for english i use the abbrv "us" is this correct?