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
    Quote from: wintertribe at Mar 04, 2015, 04:02 AM
    Weird?

    Not working for me? Still displays default english lang on both.

    Just to make sure. Is this in mml_content field on both languages?
    <ul>
    [[!$chunk_level1]]
    </ul>

    you are right, I had it only in the default language.
    As soon as I put that into the second language, I have the same issue like you have.
      -------------------------------

      you can buy me a beer, if you like MIGX

      http://webcmsolutions.de/migx.html

      Thanks!
      • 49995
      • 5 Posts
      Thanks for reply, I already set cultureKey settings to "en" but the page is always in French (I have English, Arab, and French)
        • 32507
        • 142 Posts
        If you navigate site root, it redirects to French?

        The redirect is based on browser preferences. If i got it right?

        Quote from: sottwell at Feb 20, 2015, 10:48 AM
        In other words, your browser preference settings will have an effect on which language is used in the beginning.

        On manager i consider my default language the one which TVs doesn't include Published & To translate checkboxes. I guess that's based on cultureKey(?)
          • 32507
          • 142 Posts
          I tested it on Firefox. If i change lang preferences to en it directs to en version
            • 49995
            • 5 Posts
            Yes, it redirect to French, in edition resource, English TVs are the only ones that don't have Published & To translate Option.

            I saw it in the plugins OnInitCulture, the code check user browser's language but how to avoid it and set basic default language ?
              • 49995
              • 5 Posts
              The problem is all user don't know that they must change their browser's language, I'd like to set one as the default site language. On manager, all features work but not in the front, I must switch language to see the english version
                • 49995
                • 5 Posts
                I resolve the problem, in mml_initCulture on manager, I change this code
                $clientCultureKey = array_flip(array_intersect_key(clientLangDetect(), $languages));
                if ($clientCultureKey) {
                	$_REQUEST['cultureKey'] = current($clientCultureKey);
                } else {
                	$_REQUEST['cultureKey'] = trim($modx->getOption('cultureKey'));
                }

                to
                /*$clientCultureKey = array_flip(array_intersect_key(clientLangDetect(), $languages));
                if ($clientCultureKey) {
                       $_REQUEST['cultureKey'] = current($clientCultureKey);
                } else {*/
                       $_REQUEST['cultureKey'] = trim($modx->getOption('cultureKey'));
                //}


                so, the plugin doesn't check the browser's language in the beginning, it gets the cultureKey in system settings.

                Thanks guys
                  • 4172
                  • 5,888 Posts
                  Better create a duplicate of that plugin with another name and use that new plugin.
                  Otherwise it would be overwritten on upgrades!
                    -------------------------------

                    you can buy me a beer, if you like MIGX

                    http://webcmsolutions.de/migx.html

                    Thanks!
                    • 37047 ☆ A M B ☆
                    • 309 Posts
                    Quote from: Bruno17 at Mar 04, 2015, 02:10 AM


                    You can add additional TVs with the Formmanager in the migxMultiLang - CMP
                    You can duplicate the default (example)- configuration and add tabs and fields for TVs to the form, just like you would do with any other MIGX-configuration.

                    Ah, well this is my first time using MIGX (and MML and pdoTools too!) A steep learning curve but so worth it.

                    So to clarify:

                    • 1. I duplicate the example configuration using the Duplicate button in the MML Form Manager
                    • 2. On the new configuration I click the Edit raw button and see something like this:
                    [
                      {
                        "MIGX_id":1,
                        "caption":"Document",
                        "print_before_tabs":"0",
                        "fields":[
                          {
                            "MIGX_id":1,
                            "field":"mml_pagetitle",
                            "caption":"Pagetitle",
                            "description":"",
                            "description_is_code":"0",
                            "inputTV":"",
                            "inputTVtype":"",
                            "configs":"",
                            "sourceFrom":"config",
                            "sources":"[]",
                            "inputOptionValues":"",
                            "default":""
                          },
                          {
                            "MIGX_id":2,
                            "field":"mml_longtitle",
                            "caption":"Longtitle",
                            "description":"",
                            "description_is_code":"0",
                            "inputTV":"",
                            "inputTVtype":"",
                            "configs":"",
                            "sourceFrom":"config",
                            "sources":"[]",
                            "inputOptionValues":"",
                            "default":""
                          },
                          {
                            "MIGX_id":6,
                            "field":"mml_menutitle",
                            "caption":"Menutitle",
                            "description":"",
                            "description_is_code":"0",
                            "inputTV":"",
                            "inputTVtype":"",
                            "validation":"",
                            "configs":"",
                            "sourceFrom":"config",
                            "sources":"[]",
                            "inputOptionValues":"",
                            "default":""
                          },
                          {
                            "MIGX_id":5,
                            "field":"mml_introtext",
                            "caption":"Summary (introtext)",
                            "description":"",
                            "description_is_code":"0",
                            "inputTV":"",
                            "inputTVtype":"textarea",
                            "configs":"",
                            "sourceFrom":"config",
                            "sources":"[]",
                            "inputOptionValues":"",
                            "default":""
                          },
                          {
                            "MIGX_id":3,
                            "field":"mml_content",
                            "caption":"Content",
                            "description":"",
                            "description_is_code":"0",
                            "inputTV":"",
                            "inputTVtype":"richtext",
                            "configs":"",
                            "sourceFrom":"config",
                            "sources":"[]",
                            "inputOptionValues":"",
                            "default":""
                          }
                        ]
                      }
                    ]

                    • 3. To the end of that json file I add something like:
                          {
                            "MIGX_id":7,
                            "field":"mml_secondaryContent",
                            "caption":"Secondary Content",
                            "description":"",
                            "description_is_code":"0",
                            "inputTV":"",
                            "inputTVtype":"richtext",
                            "configs":"",
                            "sourceFrom":"config",
                            "sources":"[]",
                            "inputOptionValues":"",
                            "default":""
                          }


                    Questions:
                    What happens to the original (example) configuration when I create the duplicate? Is it still used somehow and/or does it create a conflict with the new one?
                    Why not just edit the original configuration?
                    I have an existing TV I want to translate - do I add the name of that TV in "field" as it is, or does the "field" name need to begin with mml_?
                    Do I just choose a number for MIGXid field (I assume it needs to be unique)?
                      Lucy Iannotti
                      Following Sea design & development
                      http://www.following-sea.com
                      New Bedford, MA
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      Never just edit an existing working configuration, and this applies to everything from the CSS for a free template you're porting, to a custom Policy Template for user permissions, to a MIGXdb configuration. Duplicate it, give it another name, and have your TV use that configuration. That way when you mess it up you always have the original to return to for a clean re-starting point.
                        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