Moodle
  1. Moodle
  2. MDL-20381

merge current (old) local translation strings file with a new updated (english) strings file, when updating a module

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.9
    • Fix Version/s: None
    • Component/s: Language
    • Labels:
      None
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE
    • Rank:
      5561

      Description

      this little piece of code is made to help in the process of merging a current (old) translation
      strings file of some module (activity, resource,question,course_format,...) with a new version
      of a strings file that comes with a new version of that specific module (extension)

      the file is called merge-new-diff.php . i placed it inside moodle/lang. and made a sub-folder called "merge"
      under moodle/lang ( ex. moodle/lang/merge) to place the current (old) strings file and the new (updated) version of English strings file.

      HowTo:

      1. place the current (old) local language strings file and the new (updated) version of English strings file inside "merge" folder.

      2. point your browser to the merge php file ( http://you-web-site.edu/lang/merge-new-diff.php )

      3. choose those two files from the list of files that are in the "merge" folder.

      4. if it is the first time you run this script, and you just want to check the merge... press "suggest merge" button

      5. see the merge output. and if you are pleased with the merge press the "backup and merge" button for the actual process to happen.

      6. you will be asked (again) to choose (those previous files) and press the button (again) "backup and merge"

      7. the old file is now backedup and a new merged file has replaced the local language version... with all the new strings from the updated English version !

      8. manually, move the merged file to the right folder. where your local translation files reside.

      it would be nice to integrate it (some how) with Moodle's core code.
      as part of the upgrade process of new modules.

        Activity

        Hide
        David Mudrak added a comment -

        Nadav, thanks for all your work on these lang utilities. Sorry I am not able to try your script right now. Can you please attach some screenshot of how the merge process looks like?
        Note that the simple "last wins" merging strategy is easily possible with the current version, too. You just concatenate the old file and the updated version and resave it. The later string definitions override the previous ones so you end the old file with the new strings incorporated. Of course, this is not fully interactive merge.

        Also, please note there is a plan to completely rewrite the language translation interface/tool planned. We discuss the new approach to the whole translation process that should be supported by this tool (basically to make it easier to contribute to different branches of the source code).

        Show
        David Mudrak added a comment - Nadav, thanks for all your work on these lang utilities. Sorry I am not able to try your script right now. Can you please attach some screenshot of how the merge process looks like? Note that the simple "last wins" merging strategy is easily possible with the current version, too. You just concatenate the old file and the updated version and resave it. The later string definitions override the previous ones so you end the old file with the new strings incorporated. Of course, this is not fully interactive merge. Also, please note there is a plan to completely rewrite the language translation interface/tool planned. We discuss the new approach to the whole translation process that should be supported by this tool (basically to make it easier to contribute to different branches of the source code).
        Hide
        Nadav Kavalerchik added a comment -

        most of the time, it happens that my local translation strings are not the same as the ones
        i am getting from the new Module component that i am upgrading.

        so i can not just add the new English strings at the end of the local (hebrew) strings
        and start translating them.

        it is a mixed update - the new strings a mixed inside the new file. they do not come at the end of it
        and i can not use a diff tool to manage the merge. unfortunately

        i am attaching a sample screen capture of the merged files
        maybe it will make it more clear.

        i saw the MDL that responsible for the moodle v2 translation overall.
        and i think this issue could be a very nice addition to the new gui that you are planing.

        Show
        Nadav Kavalerchik added a comment - most of the time, it happens that my local translation strings are not the same as the ones i am getting from the new Module component that i am upgrading. so i can not just add the new English strings at the end of the local (hebrew) strings and start translating them. it is a mixed update - the new strings a mixed inside the new file. they do not come at the end of it and i can not use a diff tool to manage the merge. unfortunately i am attaching a sample screen capture of the merged files maybe it will make it more clear. i saw the MDL that responsible for the moodle v2 translation overall. and i think this issue could be a very nice addition to the new gui that you are planing.
        Hide
        David Mudrak added a comment -

        This issue was assigned to me, however I will not be able to work on this issue in the immediate future. In order to create a truer sense of the state of this issue and to allow other developers to have chance to become involved, I am removing myself as the assignee of this issue. For more information, see http://docs.moodle.org/dev/Changes_to_issue_assignment

        Show
        David Mudrak added a comment - This issue was assigned to me, however I will not be able to work on this issue in the immediate future. In order to create a truer sense of the state of this issue and to allow other developers to have chance to become involved, I am removing myself as the assignee of this issue. For more information, see http://docs.moodle.org/dev/Changes_to_issue_assignment

          People

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

            Dates

            • Created:
              Updated: