Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Translating plugins: Difference between revisions

From MoodleDocs
(Added Moodle has a [https://moodle.org/plugins/report/index.php?report=favourites&p=0&l=50&s=favourited&d=DESC list of the most favourite plugins])
(Added * [https://translate-h5p.tk/ h5p.tk] - a user-friendliy platfform that you can use to translate H5P strings.)
(47 intermediate revisions by 4 users not shown)
Line 3: Line 3:


* Almost all contributed plugins published in Moodle Plugins directory have been imported into [http://lang.moodle.org/ AMOS] and are ready to be translated.
* Almost all contributed plugins published in Moodle Plugins directory have been imported into [http://lang.moodle.org/ AMOS] and are ready to be translated.
*Watch this video tutorial on [https://www.youtube.com/watch?v=E_20uU1ibcA&feature=youtu.be  Translating a Moodle plugin]
* When a user is looking at the [https://moodle.org/plugins/ Moodle plugins database], in ' Description tab > Useful links section' there is a link to 'Contribute translation for (your preferred language)' that points to [http://lang.moodle.org/ AMOS].
* When a user is looking at the [https://moodle.org/plugins/ Moodle plugins database], in ' Description tab > Useful links section' there is a link to 'Contribute translation for (your preferred language)' that points to [http://lang.moodle.org/ AMOS].
* Have a look at an example for the very popular [https://moodle.org/plugins/view.php?plugin=mod_hotpot HotPot] plugin:
* Have a look at an example for the very popular [https://moodle.org/plugins/view.php?plugin=mod_hotpot HotPot] plugin:
Line 9: Line 10:


* You can click on the 'Contribute translation for (your preferred language)' link.
* You can click on the 'Contribute translation for (your preferred language)' link.
* '''CURRENTLY:''' If you do not have an account in AMOS, you would have to 'Create a new account' by using the appropriate link.
* '''CURRENTLY:''' If you do not have an AMOS account, you would have to 'Create a new account' by using the appropriate link.
* If you have a translator account at AMOS, you can use AMOS to contribute a translation.
* If you have a translator account in AMOS, you can use AMOS to contribute the translation.
* If the user then selects all the language packs (except English fixes) and writes 'pluginname' in the box for 'String identifier', AMOS will display the name of the plugin in all available translations.
* If you select all the language packs (except English fixes) and write 'pluginname' in the box for 'String identifier', AMOS will display the name of the plugin in all available translations.
* Make sure that you have selected the Moodle branch(es) that you are interested in (eg, 2.5 in the image below).
* Make sure that you have selected the Moodle branch(es) that you are interested in (eg, 2.5 in the image below).


Line 19: Line 20:
* When no translation is available for any/many language(s), the box named 'Translation' will be empty for those languages.
* When no translation is available for any/many language(s), the box named 'Translation' will be empty for those languages.
* If a plugin name has been translated, there is a fair chance (but no certainty) that this plugin has been (completely) translated into that language. You can change the settings in AMOS and check for yourself.
* If a plugin name has been translated, there is a fair chance (but no certainty) that this plugin has been (completely) translated into that language. You can change the settings in AMOS and check for yourself.
* Please help Moodle users in other languages by translating your favourite plugins. Moodle has a [https://moodle.org/plugins/report/index.php?report=favourites&p=0&l=50&s=favourited&d=DESC list of the most favourite plugins], which might be worth considering for translation  :)
* You can find the plugins with the largest number of downloads in the last year (or in the last two months) at [https://moodle.org/plugins/stats.php https://moodle.org/plugins/stats.php]. These are the plugins most likely to be most useful when translated to your language. It would probably be a good idea to translate them first.


==Plugin translation priority==
* Please help Moodle users in other languages by translating your favourite plugins.
* Moodle has a continuously updated [https://moodle.org/plugins/report/index.php?report=favourites&p=0&l=50&s=favourited&d=DESC list of the most favourite plugins], which might be worth considering for translation  :)
* In mid-2019, the [https://moodle.org/plugins/mod_hvp H5P plugin] is the most downloaded additional activity plugin and it is expected to [https://docs.moodle.org/dev/Roadmap#Moodle_3.8_and_beyond:_in_progress be incorporated into Moodle 3.8 core].
* You can find the plugins with the largest number of downloads in the last three months at [https://moodle.org/plugins/stats.php https://moodle.org/plugins/stats.php]. These are the plugins most likely to be most useful when translated to your language. It would probably be a good idea to translate them first.
* Moodle has a list of plugins that have received the [https://moodle.org/plugins/browse.php?list=award&id=1 Reviewers' choice award]. These are given by the plugins guardians and reviewers for particularly useful, well coded or otherwise interesting plugins. It would be very desirable/useful to have these translated.
* See the [https://moodle.org/mod/forum/discuss.php?d=325804 list of (year 2015) favorite plugins] by Gavin Henrick
* Special cases:
** All plugins with ''mobile'' in their name, and all [https://moodle.org/plugins/browse.php?list=set&id=62 server side plugins] to support the  [https://docs.moodle.org/38/en/Moodle_Mobile Moodle mobile app]
** [https://moodle.org/plugins/local_moodlecloudsignup MoodleCloud strings] are used for accessing the [https://moodle.com/cloud/ MoodleCloud] free and paid hosting services.
===Elementary school teaching===
If your Moodle site will serve kids, consider [https://docs.moodle.org/38/en/Language_packs#Can_I_make_a_language_pack_for_kids.3F making a language pack for kids].
===Plugins for K-12 teaching===
For [https://en.wikipedia.org/wiki/K%E2%80%9312 K-12] teaching and learning environments, please consider translating the plugins that are included in the [https://moodle.com/cloud/school/?utm_source=Sendy&utm_medium=Email&utm_campaign=Newsletter_July2016 Moodle for School at MoodleCloud]:
* [https://moodle.org/plugins/mod_attendance Attendance]
* [http://bigbluebutton.org/ BigBlueButton]
* [https://moodle.org/plugins/mod_checklist Checklist]
* [https://moodle.org/plugins/atto_chemistry Chemistry editor]
* [https://moodle.org/plugins/mod_choicegroup Group choice]
* [https://moodle.org/plugins/block_xp Level up!]
* [https://moodle.org/plugins/mod_quizgame Quizventure]
* [https://moodle.org/plugins/tinymce_wordcount Word count]
===Plugins for University teaching===
For universities, there is a [https://docs.moodle.org/38/en/Tertiary_education#Moodle_plugins_by.2Ffor_Universities list of plugins by/for Universities], and a [https://docs.moodle.org/38/en/Tertiary_education#Discipline-specific_plugins link to discipline-specific plugins], which might be worth translating.
==H5P plugin==
While the [https://moodle.org/plugins/mod_hvp H5P plugin for Moodle] is currently (April 2020) installed in 14333 sites, and the Moodle roadmap shows 'improved H5P integration' contemplated for Moodle 3.8 and beyond, only 30 languages (April 2020) have any translated language strings in AMOS.
[[File:H5P editor french language.png|600px]]
Even after translating the [https://moodle.org/plugins/mod_hvp H5P plugin for Moodle] in AMOS, most users of this plugin in languages other than English may see (partly or totally) untranslated strings when using it. This is because all H5P libraries ("components" / "plugins") have their own separate [https://github.com/h5p/h5p-contribution-docs/blob/master/en/translations.md translation infrastucture] which is not related to the H5P Moodle plugin and we are not sure what is the frequency of merging and distributing the contributed translation pull requests that we see on each library's repository on GitHub.
[[File:H5P editor es_mx language.png|600px]]
There is a page providing an overview of the H5P content-type translation status at [https://localization.h5p.org/  https://localization.h5p.org/ ]
[[File:H5P_translation_02.png|600px]]
When you click on a language (Spanish in this example), you will see all the H5P modules with the proportion of strings translated into that language.
[[File:H5P translation 03.png|600px]]
When you click on a module (Audio in this example) you will see a list of all the untranslated and translated strings for that language for that module
[[File:H5P translation 04.png|600px]]
At the botton of that page, there will be a link to 'Head over to the source repository'. If you click on that link, you will be taken to the GitHub page for that module, where you can fix or add the translations for your language and make a 'Pull request' to contribute this translation.
[[File:H5P translation 05.png|600px]]
See also:
* [https://translate-h5p.tk/ h5p.tk] - a user-friendliy platfform that you can use to translate H5P strings.
* the [https://h5p.org/adding-content-type-translation-via-github Guide for Adding content type translations via GitHub].


==Non-translatable strings==
==Non-translatable strings==
While AMOS does a great job for translating the Moodle core and most Moodle plugin language strings, some English language strings are (as of February 2015) not yet available for translation with AMOS.
While AMOS does a great job for translating the Moodle core and most Moodle plugin language strings, some English language strings are not available for translation with AMOS.


===Plugins in the [https://moodle.org/plugins/browse.php?list=category&id=38 Other] category===
===Plugins in the [https://moodle.org/plugins/browse.php?list=category&id=38 Other] category===
Line 30: Line 86:


===Plugins with coding errors===
===Plugins with coding errors===
Some plugins (of types different from 'Other') available for download in the [https://moodle.org/plugins/ Moodle plugins directory] may not  have English language strings available for translation in [https://lang.moodle.org/ AMOS] because of [https://docs.moodle.org/dev/index.php?title=Plugin_contribution_checklist&redirect=no coding errors], that must be identified and fixed by the plugin maintainer:
Some plugins (of types different from 'Other') available for download in the [https://moodle.org/plugins/ Moodle plugins directory] may not  have English language strings available for translation in [https://lang.moodle.org/ AMOS] because of [https://docs.moodle.org/dev/index.php?title=Plugin_contribution_checklist&redirect=no coding errors], that must be identified and fixed by the plugin maintainer, See [https://docs.moodle.org/dev/Plugin_contribution_checklist#Strings Plugin contribution checklist:Strings]:
* The plugin code must not rely on trailing and leading whitespace in strings.
* The plugin code must not rely on trailing and leading whitespace in strings.
* The string file must be considered as pure data file with the syntax $string['id'] = 'value';
* The string file must be considered as pure data file with the syntax $string['id'] = 'value';
* No other PHP syntax such as [http://php.net/manual/en/language.operators.string.php concatenation], [http://php.net/manual/en/language.types.string.php heredoc and nowdoc] is supported by the tools that AMOS use when processing the strings (even if it may work in Moodle itself).
* No other PHP syntax such as [http://php.net/manual/en/language.operators.string.php concatenation], [http://php.net/manual/en/language.types.string.php heredoc and nowdoc] is supported by the tools that AMOS use when processing the strings (even if it may work in Moodle itself).
* Use neither string concatenation operators nor other PHP logic inside string files. Those should really be considered as plain data files with simple $string['key'] = 'value'; syntax, nothing more.
* Use neither string concatenation operators nor other PHP logic inside string files. Those should really be considered as plain data files with simple $string['key'] = 'value'; syntax, nothing more.
===Plugins with hard-wired English language strings===
Sometimes you might have translated 100% of the strings available in AMOS for a given plugin, and you can still view the original English (non-translated) strings.
* Please check that you have purged your browser cache and the server cache, waited for one hour (for AMOS to update the language packs), and updated your language packs.
* If the problem persists, please write the plugin maintainer by clicking at the 'Bug tracker' link shown in the given plugin's page in the [https://moodle.org/plugins/index.php Moodle plugins database].
* If the plugin author has nested additional 'Lang' folders inside any subdirectories within the plugin folder structure, the English language strings in these nested Lang folder will not be available for AMOS, and they would seem to be hard-wired. Please contact the plugin author.
* Most Moodle plugin authors have been very fast at replacing the English hard-coded strings with strings variables that can now be translated in AMOS.
* If you suspect the problem is in a core plugin, you can post an issue in the [https://lang.moodle.org/mod/forum/view.php?id=5 AMOS translation forum].
===Log descriptions can not be translated===
* See [https://docs.moodle.org/dev/Translation_FAQ#Why_are_log_descriptions_displayed_in_English.3F why log descriptions are not translated].
===Items that must NOT be translated===
* See the [https://docs.moodle.org/dev/Translation_FAQ#Are_there_items_which_are_not_to_be_translated.3F Items that are not to be translated] in the [https://docs.moodle.org/dev/Translation_FAQ Translation FAQ]


==If translations are available in AMOS for some Moodle branches but not available for other branches==
==If translations are available in AMOS for some Moodle branches but not available for other branches==
Line 45: Line 115:


[[File:Found language file debugging message.jpg|400px]]
[[File:Found language file debugging message.jpg|400px]]
The Language strings inside a properly installed downloaded plugin will overwrite the strings translations of the language pack, but they can be overwritten by the strings defined with the Language customization.
===Strings priority===
When displaying text language strings, Moodle 2.x and 3.x will have the following priority:
# Strings defined by the [[:en:Language customization|language customization]] tool
# Strings defined in an installed child language pack (eg, the es_ve language pack)
# Strings defined in an installed parent language pack (eg, the es language pack)
# Strings enclosed inside the plugin_name/lang/xx/yy.php folder (where xx is a language code other than the en folder) from a downloaded and installed plugin ZIP file (eg, inside the /server/moodle/theme/adaptable/lang/es/theme_adaptable.php file)
# Original Australian English language strings shipped with the downloaded Moodle branch.
# Original Australian English language strings inside the /lang/en folder in the downloaded/updated plugin ZIP file
Note: See the [https://moodle.org/plugins/local_string_override local String override plugin] that makes it possible for plugins to override existing translations regardless if they're bundled with Moodle or they're originated from a community plugin.


==See also==
==See also==


* [http://lang.moodle.org/mod/forum/discuss.php?d=2485 Contributed plugins are now automatically imported into AMOS] announcement explaining the mechanism
* [http://lang.moodle.org/mod/forum/discuss.php?d=2485 Contributed plugins are now automatically imported into AMOS] announcement explaining the mechanism
* [https://docs.moodle.org/dev/Translation_FAQ#Are_there_items_which_are_not_to_be_translated.3F Items that are not to be translated] in the [https://docs.moodle.org/dev/Translation_FAQ Translation FAQ]


[[Category:Plugins]]
[[Category:Plugins]]

Revision as of 19:11, 24 November 2020

Looking for translated plugins in the Moodle plugins database

  • Almost all contributed plugins published in Moodle Plugins directory have been imported into AMOS and are ready to be translated.
  • Watch this video tutorial on Translating a Moodle plugin
  • When a user is looking at the Moodle plugins database, in ' Description tab > Useful links section' there is a link to 'Contribute translation for (your preferred language)' that points to AMOS.
  • Have a look at an example for the very popular HotPot plugin:

Link to Plugin translations in Moodle plugins database.png

  • You can click on the 'Contribute translation for (your preferred language)' link.
  • CURRENTLY: If you do not have an AMOS account, you would have to 'Create a new account' by using the appropriate link.
  • If you have a translator account in AMOS, you can use AMOS to contribute the translation.
  • If you select all the language packs (except English fixes) and write 'pluginname' in the box for 'String identifier', AMOS will display the name of the plugin in all available translations.
  • Make sure that you have selected the Moodle branch(es) that you are interested in (eg, 2.5 in the image below).

Plugins translations in AMOS.png

  • In the above example, there are a total of 123 different language packs registered in AMOS; 63 of these are missing a translation for HotPot, which means that there are 60 different language translations already available for the HotPot plugin, a fair number for this popular plugin :)
  • When no translation is available for any/many language(s), the box named 'Translation' will be empty for those languages.
  • If a plugin name has been translated, there is a fair chance (but no certainty) that this plugin has been (completely) translated into that language. You can change the settings in AMOS and check for yourself.

Plugin translation priority

Elementary school teaching

If your Moodle site will serve kids, consider making a language pack for kids.

Plugins for K-12 teaching

For K-12 teaching and learning environments, please consider translating the plugins that are included in the Moodle for School at MoodleCloud:

Plugins for University teaching

For universities, there is a list of plugins by/for Universities, and a link to discipline-specific plugins, which might be worth translating.

H5P plugin

While the H5P plugin for Moodle is currently (April 2020) installed in 14333 sites, and the Moodle roadmap shows 'improved H5P integration' contemplated for Moodle 3.8 and beyond, only 30 languages (April 2020) have any translated language strings in AMOS.

H5P editor french language.png

Even after translating the H5P plugin for Moodle in AMOS, most users of this plugin in languages other than English may see (partly or totally) untranslated strings when using it. This is because all H5P libraries ("components" / "plugins") have their own separate translation infrastucture which is not related to the H5P Moodle plugin and we are not sure what is the frequency of merging and distributing the contributed translation pull requests that we see on each library's repository on GitHub.

H5P editor es mx language.png

There is a page providing an overview of the H5P content-type translation status at https://localization.h5p.org/

H5P translation 02.png

When you click on a language (Spanish in this example), you will see all the H5P modules with the proportion of strings translated into that language.

H5P translation 03.png

When you click on a module (Audio in this example) you will see a list of all the untranslated and translated strings for that language for that module

H5P translation 04.png

At the botton of that page, there will be a link to 'Head over to the source repository'. If you click on that link, you will be taken to the GitHub page for that module, where you can fix or add the translations for your language and make a 'Pull request' to contribute this translation.

H5P translation 05.png

See also:

Non-translatable strings

While AMOS does a great job for translating the Moodle core and most Moodle plugin language strings, some English language strings are not available for translation with AMOS.

Plugins in the Other category

The plugins classified as 'Other ' (Utilities, Experimental or Incubating) are not translatable by AMOS (see this forum thread). You can use the language customization tool within your Moodle (production or local) server to produce the .php file containing the translated language strings for your language and email this file to the particular 'other' plugin maintainer, so that it can be included in the lang folder within the downloadable Zip file for the plugin.

Plugins with coding errors

Some plugins (of types different from 'Other') available for download in the Moodle plugins directory may not have English language strings available for translation in AMOS because of coding errors, that must be identified and fixed by the plugin maintainer, See Plugin contribution checklist:Strings:

  • The plugin code must not rely on trailing and leading whitespace in strings.
  • The string file must be considered as pure data file with the syntax $string['id'] = 'value';
  • No other PHP syntax such as concatenation, heredoc and nowdoc is supported by the tools that AMOS use when processing the strings (even if it may work in Moodle itself).
  • Use neither string concatenation operators nor other PHP logic inside string files. Those should really be considered as plain data files with simple $string['key'] = 'value'; syntax, nothing more.

Plugins with hard-wired English language strings

Sometimes you might have translated 100% of the strings available in AMOS for a given plugin, and you can still view the original English (non-translated) strings.

  • Please check that you have purged your browser cache and the server cache, waited for one hour (for AMOS to update the language packs), and updated your language packs.
  • If the problem persists, please write the plugin maintainer by clicking at the 'Bug tracker' link shown in the given plugin's page in the Moodle plugins database.
  • If the plugin author has nested additional 'Lang' folders inside any subdirectories within the plugin folder structure, the English language strings in these nested Lang folder will not be available for AMOS, and they would seem to be hard-wired. Please contact the plugin author.
  • Most Moodle plugin authors have been very fast at replacing the English hard-coded strings with strings variables that can now be translated in AMOS.
  • If you suspect the problem is in a core plugin, you can post an issue in the AMOS translation forum.

Log descriptions can not be translated

Items that must NOT be translated

If translations are available in AMOS for some Moodle branches but not available for other branches

Sometimes a plugin may have its English language strings available for translations for some Moodle branches (e.g. 2.0 to 2.4), but not for other branches (e.g. 2.5 to 2.7), even though the plugin itself is indeed available for download for all branches (2.0 to 2.7) in the Moodle plugins database.

Please see an example in this post. The cause is very likely a programming error (see 'Plugins with coding errors' above), that must be fixed by the plugin maintainer.

What happens if a plugin ZIP file includes translation(s) inside the lang folder

If a site has debugging on, there will be a warning message about 'Found language file' when the user installs the plugin, but the installation may proceed.

Found language file debugging message.jpg

The Language strings inside a properly installed downloaded plugin will overwrite the strings translations of the language pack, but they can be overwritten by the strings defined with the Language customization.

Strings priority

When displaying text language strings, Moodle 2.x and 3.x will have the following priority:

  1. Strings defined by the language customization tool
  2. Strings defined in an installed child language pack (eg, the es_ve language pack)
  3. Strings defined in an installed parent language pack (eg, the es language pack)
  4. Strings enclosed inside the plugin_name/lang/xx/yy.php folder (where xx is a language code other than the en folder) from a downloaded and installed plugin ZIP file (eg, inside the /server/moodle/theme/adaptable/lang/es/theme_adaptable.php file)
  5. Original Australian English language strings shipped with the downloaded Moodle branch.
  6. Original Australian English language strings inside the /lang/en folder in the downloaded/updated plugin ZIP file

Note: See the local String override plugin that makes it possible for plugins to override existing translations regardless if they're bundled with Moodle or they're originated from a community plugin.

See also