We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9994
    • 133 Posts
    Somehow i can’t add any new languages, is it a setting whats wrong or?

    When i try i get the message: Could not add language with lang id "xx"



      Best CMS eva!
      • 22851
      • 805 Posts
      The most likely problem is that config file is not writeable by the apache user/group. Are you able to change any of the other settings, such as those on the Other Params tab? After making a change, try refreshing the page to see if the setting goes back to its original value.

      Alternatively, it could be that one of the new language fields contained some information in an unrecognised format. If so, perhaps you could provide a list/screenshot of the info you were trying to enter when adding the new language.
        YAMS: Yet Another Multilingual Solution for MODx
        YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
        Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
        • 9994
        • 133 Posts
        Well, i checked the config file, its 777 and all the folders are also 777.
        I can change the Other Params settings.
        When i want to add a language called ’test’ it won’t save it.

        What i did after the ’bug’ is i uploaded a YAMS folder from a other website i made.
        Now i do have the other language only when i want to add a other one it still doesnt work.

        So it’s ok right now but still it’s a bit weird it doesn’t work.
          Best CMS eva!
          • 22851
          • 805 Posts
          Please could you provide the details for the new language you are trying to add? You can send me a personal message with the details if you like. It would also be useful to be able to see your config file.
            YAMS: Yet Another Multilingual Solution for MODx
            YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
            Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
            • 17024
            • 8 Posts
            I have a same problem. Please, help me somebody.
            • There does appear to be problems with the last version (1.2.0 rc3). It sometimes writes the config file, sometimes it doesn’t. There doesn’t seem to be any particular pattern to it. Usually the first effort at deleting/editing/adding anything doesn’t get written; sometimes the second or third attempt will get written.

              The config file is always read/written as iso-latin1, which of course breaks any other encoding for the language options other than western languages (in my case Russian and Hebrew in UTF-8). Even the original installation Russian and Japanese language setting options are garbage or just blank in the form; garbage in the config file. I’ve tested by manually editing the config file as UTF-8 and saving it; the domain control panel (CPanel) file viewer shows it fine, the MODx file manager view is fine, but YAMS has garbage or blank fields, and if I save the file through YAMS it’s saved as iso-latin1 again (with garbage).

              I’ve poked through the language encoding classes and functions, but it’s beyond me what it’s doing (or not doing).
                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
              • Version 1.1.9 has no problem with the config file; it’s written as utf-8. However, it does require two attempts at adding a new language before it actually adds it.
                  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
                • The problem appears to be in the YamsUtils::AsPHPSingleQuotedString() function. If I replace the section for generating the language settings options to be written to file with the one from the older version (before this function was applied to the form POST values) it writes to a UTF-8 file with all characters correctly represented (although it still won’t read them; it’s still loading the file as latin1 and I haven’t found the code where it loads the fields into the form yet).

                  I can’t even find this function, so I have no idea what it’s supposed to be doing.
                    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
                    • 15083
                    • 697 Posts
                    Hi guys,

                    Im’ using this with EVO 1.0.4 and its not working either.
                    I cannot add any new langs, regardless of permissions.

                    I was able to delete the langs fine, but no adding im afraid smiley
                    Gonna try edit the config file manually, i’ll post results.

                    J

                      • 15083
                      • 697 Posts
                      Hi guys,

                      I noted two weird things:
                      Having set the permissions of the YAM config file to 777, I noticed it got changed back at some point, hence all the grief u guys are getting above.

                      I opened the config file locally and added my language.
                      I copied it back up to the server and CHMOD’ed it again.
                      Activated the Lang - which worked.

                      This is not stable, but then again its not tested with Evo so I can’t complain smiley

                      J