We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8548
    • 104 Posts
    Hi all, maybe someone could help me.

    I've installed and configured MigxMultiLang on my site wich as multiple context (sites).
    the site with multiple language is working correctly (exept for the default lang) but that not the issue.

    I've assign specific template to MigxMultiLang, who are for the multilang contexte, but my other site (who is one language only) is trying to change language, so it has added /fr everywhere, so now no access to style, and images cause the path /fr is added and does not existe for that contexte/templates.

    any hepl will be appreciated.

    Cheers,

    This question has been answered by Bruno17. See the first response.

      • 4172
      • 5,888 Posts
      In the plugin 'mml_initCulture'

      when you comment this line, like that:

                      if (empty($reqCultureKey)) {
                          //$modx->sendRedirect($_REQUEST['cultureKey'] . '/' . $_REQUEST['q']);
                      }


      does it work, then?
      Will try to integrate a solution with a context-setting to the next version.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 8548
        • 104 Posts
        Thank you Bruno,

        I don't find that exact same line in the last version of mml, here's what I have containing $reqCultureKey;
                        # Determine language from request
                        $reqCultureKeyIdx = strpos($_REQUEST['q'], '/');
                        $reqCultureKey = substr($_REQUEST['q'], 0, $reqCultureKeyIdx);
        
                        # Serve the proper context and language
                        if (array_key_exists(strtolower($reqCultureKey), array_change_key_case($languages))) {
                            # Remove cultureKey from request
        
                            $_REQUEST['q'] = substr($_REQUEST['q'], $reqCultureKeyIdx + 1);
                            $_REQUEST['cultureKey'] = $reqCultureKey;
        
                            if ($_REQUEST['q']) {
        
                            } else {
                                // $_REQUEST['q'] shouldn't be empty
                                $_REQUEST['q'] = '_mml_home';
                            }
        
                            # logRequest('Culture key found in URI');
                        } else {
                            $clientCultureKey = array_flip(array_intersect_key(clientLangDetect(), $languages));
                            if ($clientCultureKey) {
                                $_REQUEST['cultureKey'] = current($clientCultureKey);
                            } else {
                                $_REQUEST['cultureKey'] = trim($modx->getOption('cultureKey'));
                            }
                        }

        Should I comment ou this line?
                            if ($_REQUEST['q']) {
        
                            } else {
                                // $_REQUEST['q'] shouldn't be empty
                               // $_REQUEST['q'] = '_mml_home';
                            }
        • discuss.answer
          • 4172
          • 5,888 Posts
          sorry, this lines was only at a special setup on mine.
          So you shouln't need to change anything in the plugin.

          Then, it should be enough to create a context-setting

          mml.do_translate with a value of '0'

          does this work?
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 8548
            • 104 Posts
            Oh yeah! Bruno that did the trick, thank you very much fur the help and the great addon.

            Cheers!