Moodle
  1. Moodle
  2. MDL-19468

New auth_xxx language strings breaks backward compatibility

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.5
    • Fix Version/s: None
    • Component/s: Administration
    • Labels:
      None
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_19_STABLE
    • Rank:
      12913

      Description

      The just released new auth_xxx.php language strings as well the reduced auth.php found in th English language pack break backward compatibility when a non-English language pack uses the same schema in 19.x or previous versions of Moodle.

      While in Moodle 2.0 the new language strings schema works fine, in previous version of Moodle strings are still searched in auth.php, thus on non-English language all plugins strings default to English.

      Workaround:
      keep ORPHANED strings in auth.php

      1. split.lang.packs.20081008.patch
        252 kB
        Sam Hemelryk
      2. tool.auth.lang.split.php
        12 kB
        Sam Hemelryk
      3. tool.auth.lang.split.v2.php
        14 kB
        Sam Hemelryk

        Issue Links

          Activity

          Hide
          Tim Hunt added a comment -

          Yes, we need to keep orphaned strings in auth.php.

          Also, we should automatically create the new auth_xxx.php lang files for all languages - that should be an easy script to write. Much more sensible that translators for 80 different languages doing it manually.

          Assigning to Sam.

          Show
          Tim Hunt added a comment - Yes, we need to keep orphaned strings in auth.php. Also, we should automatically create the new auth_xxx.php lang files for all languages - that should be an easy script to write. Much more sensible that translators for 80 different languages doing it manually. Assigning to Sam.
          Hide
          Tim Hunt added a comment -

          I meant to add, related forum discussion: http://moodle.org/mod/forum/discuss.php?d=126835

          Show
          Tim Hunt added a comment - I meant to add, related forum discussion: http://moodle.org/mod/forum/discuss.php?d=126835
          Hide
          Andrea Bicciolo added a comment -

          Tim,
          thanks for the comment. Please make sure automated creation do not overwrite existing file: I have already committed the new splitted aut_xxx.php

          Show
          Andrea Bicciolo added a comment - Tim, thanks for the comment. Please make sure automated creation do not overwrite existing file: I have already committed the new splitted aut_xxx.php
          Hide
          Martin Dougiamas added a comment -

          In 1.9.5+ the code searches the new auth_xxxx locations.

          But yes, creating all the auth_xxx.php files in all lang packs would be a good idea for all those non-English users.

          And we need to keep ALL strings in auth.php for compat with 1.8, old 1.9 etc ...

          Show
          Martin Dougiamas added a comment - In 1.9.5+ the code searches the new auth_xxxx locations. But yes, creating all the auth_xxx.php files in all lang packs would be a good idea for all those non-English users. And we need to keep ALL strings in auth.php for compat with 1.8, old 1.9 etc ...
          Hide
          Sam Hemelryk added a comment -

          Hi Guys,
          I've written a small patch the does the following things for every language pack in Moodle:

          1. Copy any strings defined in auth_*.php that are not in auth.php into auth.php
          2. Create auth_*.php files if they don't already exist based on the files in en_utf8
          3. Copy module specific strings from auth.php to auth_module.php files based on the strings as they exist in en_utf8

          This ensures that all language packs have a language file for all auth plugins, and that all auth strings are duplicated in auth.php to ensure backwards compatibility.

          If someone could please have a look at the patch just to make sure everything is OK. I've also attached the script I used encase anyone in the future needs to do something similar.

          Cheers all
          Sam

          Show
          Sam Hemelryk added a comment - Hi Guys, I've written a small patch the does the following things for every language pack in Moodle: 1. Copy any strings defined in auth_*.php that are not in auth.php into auth.php 2. Create auth_*.php files if they don't already exist based on the files in en_utf8 3. Copy module specific strings from auth.php to auth_module.php files based on the strings as they exist in en_utf8 This ensures that all language packs have a language file for all auth plugins, and that all auth strings are duplicated in auth.php to ensure backwards compatibility. If someone could please have a look at the patch just to make sure everything is OK. I've also attached the script I used encase anyone in the future needs to do something similar. Cheers all Sam
          Hide
          Sam Hemelryk added a comment -

          Added Jerome as QA, thanks Jerome

          Show
          Sam Hemelryk added a comment - Added Jerome as QA, thanks Jerome
          Hide
          Martin Dougiamas added a comment -

          The format of the resulting files is slightly different to normal ... subtle differences in quoting/string delimeters could cause regressions.

          I recommend building up the files in arrays and then using the lang_save_file() function to save them into files. Gives you a shorter script too.

          A look at admin/lang.php could be useful too.

          Show
          Martin Dougiamas added a comment - The format of the resulting files is slightly different to normal ... subtle differences in quoting/string delimeters could cause regressions. I recommend building up the files in arrays and then using the lang_save_file() function to save them into files. Gives you a shorter script too. A look at admin/lang.php could be useful too.
          Hide
          Sam Hemelryk added a comment -

          Cheers for the feedback Martin.
          I have attached the revised tool, it now properly fixes the strings before writing them to the file and uses single quotes rather than double.
          I won't attach the new patch as it is very large (1.8M) however I have shown this to Martin and after some testing I will start commiting language pack changes.

          Show
          Sam Hemelryk added a comment - Cheers for the feedback Martin. I have attached the revised tool, it now properly fixes the strings before writing them to the file and uses single quotes rather than double. I won't attach the new patch as it is very large (1.8M) however I have shown this to Martin and after some testing I will start commiting language pack changes.
          Hide
          Sam Hemelryk added a comment -

          Done, and done.
          auth_*.php files have been created for all language packs that have an auth.php file, and at the same time language strings for those packs were fixed as required by this issue.
          I tested several language packs with a couple of auth methods, and ran lint over every single file that was changed.

          Show
          Sam Hemelryk added a comment - Done, and done. auth_*.php files have been created for all language packs that have an auth.php file, and at the same time language strings for those packs were fixed as required by this issue. I tested several language packs with a couple of auth methods, and ran lint over every single file that was changed.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: