We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4172
    • 5,888 Posts
    Description

    migxMultiLang is a simple to use Multi - Language - Solution for MODX Revolution

    Features

    This MODX Revolution Extra is a simple to use Multi - Language - Solution.
    All Tranlations and Language - switchings are done on the same Resource.
    No Contexts or Language - Folders are needed.
    No special .htaccess is needed
    Does work with FURLs on and off

    Requirements

    MIGX
    http://modx.com/extras/package/migx

    pdoTools - min-version: 1.9.0 pl (tested only with this version)
    http://modx.com/extras/package/pdotools

    for more information see: https://github.com/Bruno17/migxmultilang [ed. note: Bruno17 last edited this post 10 years, 2 months ago.]
      -------------------------------

      you can buy me a beer, if you like MIGX

      http://webcmsolutions.de/migx.html

      Thanks!
    • This uses MIGX and a pre-release version of pdoTools, so make sure you have them installed. It's almost like YAMS for Evo. And don't forget that you can use lexicon tags for small items like form prompts.
        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
        • 44870
        • 35 Posts
        Hi, is there a way to synchronize default - language standard variables with migxmultilang TVs ? (eg. automatically put [[*content]] into [[mml_content]] for default language ). It would be useful feature when rebuilding one-language site into multilanguage site. Clients are used to put pagetitle, description or default content in "Document" tab.
          • 4172
          • 5,888 Posts
          I think, we shouldn't change the way how its thought to work in general.
          IMO all translatable fields should be handled the same way.

          But of course, this can be customized, if really necessary.
          I'm not sure, if this would more confuse, than help, having the default language-values in fields like pagetitle, longtitle, menutitle, content
          and the other languages in fields like mml_pagetitle, mml_longtitle, mml_menutitle, mml_content

          you would need to create a modified version of the snippet mmlTranslatePdoToolsRow
          which does set the translated values for all placeholders.
          you need to set the translated mml_pagetitle to pagetitle, mml_longtitle to longtitle, mml_content to content.

          You can also create a modified version of the processor-file fields.php and update.php
          or remove the default-language completly from translations-grid if you like so.

          But again. Not sure, if its a good idea to edit the default language-fields at another place, than all other languages.

          Isn't it cleaner to have them all at the same place?

          A one-time transfer-script (from default fields into the TVs) wouldn't be a very big deal.





            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 44870
            • 35 Posts
            Quote from: Bruno17 at Jan 18, 2014, 09:03 PM

            I'm not sure, if this would more confuse, than help, having the default language-values in fields like pagetitle, longtitle, menutitle, content
            and the other languages in fields like mml_pagetitle, mml_longtitle, mml_menutitle, mml_content
            Quote from: Bruno17 at Jan 18, 2014, 09:03 PM

            A one-time transfer-script (from default fields into the TVs) wouldn't be a very big deal.
            What about big sites that are one-language and we want to make just few multilingual documents? I think it would be good idea to edit only translations in TVs tab without converting all site to that purpose.
            Of course it's my individual opinion.
            Thank you for your tips. I will test it.
              • 4172
              • 5,888 Posts
              OK, this does now translate into resourcefield - placeholders, too, by default.
              https://github.com/Bruno17/migxmultilang/commit/4c3898065a28017a7bff468cd8006f616e39869b

              If one does not want this, for example he wants to use the default resourcefields for other values

              he can set the properties
              &translateResourcefields=`0`


              and if only some should be translated into resourcefield-placeholders

              &resourcefields=`menutitle,pagetitle,longtitle`


              by default all translated values are also translated into all translatable resourcefields, which are:
              pagetitle,longtitle,introtext,description,menutitle,content

              If the translated value is emtpy, the resourcefield-placeholders stay untouched.
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
              • I'm having trouble understanding exactly what this is doing. Can you please explain?
                  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
                  • 4172
                  • 5,888 Posts
                  lets say, you had pdoMenu - snippet - call:

                           [[!pdoMenu? 
                              &startId=`0` 
                              &includeTVs=`mml_pagetitle,mml_menutitle`
                              &level=`1`
                              &prepareTVs=`1`
                              &tvPrefix=`tv.`
                              &loadModels=`migxmultilang`
                              &prepareSnippet = `mmlTranslatePdoToolsRow`
                              &tpl=`mml_MenuRowTpl`
                              &outerClass=`nav navbar-nav`
                          ]]
                  


                  and a tpl with:

                  <li[[+classes]]><a href="[[+link]]" [[+attributes]]>[[+tv.mml_menutitle]]</a>[[+wrapper]]</li>


                  this is the menutitle-placeholder, which gets the translated menutitle, of the current language:
                  [[+tv.mml_menutitle]]


                  this did only work, if you had filled this TV for every Resource, of course.
                  There couldn't be normal untranslatable Resources, which didn't have the TV mml_menutitle

                  Now, its possible to have a tpl with:
                  <li[[+classes]]><a href="[[+link]]" [[+attributes]]>[[+menutitle]]</a>[[+wrapper]]</li>


                  and menutitle does get translated, too.

                  There can be normal Resources now, without the translations-TV mixed with translatable Resources (which have the mml_menutitle - TV)

                  This is working the same way with all pdoTools - snippets.
                    -------------------------------

                    you can buy me a beer, if you like MIGX

                    http://webcmsolutions.de/migx.html

                    Thanks!
                  • So if there is [[+menutitle]] it will first look for a tv.mml_menutitle for the current cultureKey, and if this is empty will use the value in the resource field?
                      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
                      • 4172
                      • 5,888 Posts
                      1. set tv.mml_menutitle to mml.tv.mml_menutitle (if the current cultureKey is not the default - cultureKey and mml.tv.mml_menutitle is not empty)

                      2. set menutitle to tv.mml_menutitle (if tv.mml_menutitle is not empty)
                        -------------------------------

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!