Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-65160

In-place translation (or click-to-translate)



    • Type: New Feature
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: DEV backlog, Future Dev
    • Fix Version/s: None
    • Component/s: Language, Translation
    • Labels:


      This feature is about allowing users with language editing capabilities to click on untranslated or mistranslated strings in order to edit them.

      There is a very old proposed patch about it in this issue: https://tracker.moodle.org/browse/MDL-21880

      This blog post describes how it works: http://abautu.blogspot.com/2010/03/click-to-translate-feature-for-moodle.html

      Another way to implement this feature may be like this:

      1. Modify the function `get_string()` to track all the strings used at the current page and their translations.
      2. Append all these strings and translations at the end of to the current page, maybe in a hidden form.
      3. Add a link at the footer of the page (or on the menu) that says "Edit translations on this page".
      4. When this link is clicked, a form or JS overlay can appear which allows to edit the translations of the strings appearing on this page.
      5. When changes are saved, they are stored as local modifications of the translation, on the directory moodledata/lang/xx_local/ (where xx is the code of the language). For more details about local language customisations see: https://docs.moodle.org/36/en/Language_customisation
      6. After changes are saved, the page should be refreshed and the new translations should appear on it.
      7. The files of local language customizations (on moodledata/lang/xx_local/) can be uploaded to https://lang.moodle.org/ . On "AMOS -> Stage" there is an option that says "Import translated strings from file" which allows to import these files. It is also possible to upload all the files at ones, if they are ZIP-ed.

      Some other discussions related to this issue:

      This project can also be seen as an extension or improvement of the language customization feature, or maybe it can borrow some code from it (for example the part that saves translations on local translation files).


          Issue Links



              • Assignee:
                dashamirhoxha Dashamir Hoxha
                Component watchers:
                cameron1729, David Mudrák (@mudrd8mz), Helen Foster, David Mudrák (@mudrd8mz), Helen Foster
              • Votes:
                1 Vote for this issue
                2 Start watching this issue


                • Created: