Note: You are currently viewing documentation for Moodle 2.5. Up-to-date documentation for the latest stable version of Moodle may be available here: Translation.

Translation: Difference between revisions

From MoodleDocs
(→‎Using the AMOS translation tool: adding note about previous versions in Amos interface)
m (added link to docs about reporting an error in English language)
 
(43 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{Moodle 2.0}}
{{Language}}
==So you'd like to help with translating Moodle?==


== Moodle 1.x ==
Great! :-) Please check the [[dev:Language packs without maintainer|list of language packs without maintainer]]. If your language is listed, and you'd like to volunteer to become language pack maintainer, email our translation coordinator, Koen, [mailto:translation@moodle.org translation@moodle.org].


The following text described the process of Moodle translation for version 2.0 and higher. For Moodle 1.x, please follow [[Translation]].
Otherwise, check the [[:dev:Translation credits|Translation credits]] and contact the maintainer of your language pack to ask where you can help. The name at the top of the list for each language is the current language pack maintainer. (If you don't receive a response within a reasonable time, email Koen [mailto:translation@moodle.org translation@moodle.org].)


== Summary of changes since 1.x ==
==Getting started==


* Translations are not kept in CVS any more but in a database at http://lang.moodle.org
The Moodle languages portal http://lang.moodle.org/ enables translators to work collaboratively on language packs and submit translations using a special Moodle translation tool called ''AMOS''.
* A web interface is used to translate strings
* All plugins now define their English strings in the plugin folder, as contrib plugins used to
* Language codes no longer have a _utf8 suffix
* HTML help files have been replaced with [[Development:Help strings|strings with a _help suffix]]
* Placeholders must be wrapped in curly braces
* Double quotes should not be escaped any more in the string definition


== Structure of a Moodle 2.x language pack ==
To help with translating Moodle


The standard Moodle distribution comes with English language pack only. All other languages must be added to your installation. The English strings for Moodle core (that is the main subsystems like administration, gradebook, roles etc) can be found in ''lang/en/'' folder of your Moodle installation. For example, grading related strings are defined in ''lang/en/grades.php''. All other Moodle components (like activity modules, blocks, enrolment plugins etc) define their own strings in ''lang/en/'' folder within the plugin directory. For example, Workshop module defines its strings in ''mod/workshop/lang/en/workshop.php''.
# [http://lang.moodle.org/login/signup.php Create an account] on the portal, making sure you provide your full name (in order for you to receive credit for your translation work) and contact email.
# See the info [http://lang.moodle.org/mod/page/view.php?id=9 Help for newcomers].
# Access the AMOS translation tool via the link in the navigation block and see the [[AMOS|AMOS documentation]].
# Check the [https://docs.moodle.org/dev/Translation_langconfig langconfig] file first, before translating other files.


Translations are located in your ''moodledata'' directory, in folder ''lang/xx/''. Translations of all the components - both core and plugins - are stored there. For example, the Czech translation of the Workshop module is stored in ''moodledata/lang/cs/workshop.php'' and grade-related strings in ''moodledata/lang/cs/grades.php'' (note the difference against the English strings).
If you have any questions, please enrol in the [http://lang.moodle.org/course/view.php?id=2 Translating Moodle course] and join the discussions there.


The language files all have a .php extension (eg ''moodle.php'' or ''workshop.php''). These files contains short phrases, often called "strings". Strings may contain a placeholder for variable substitution. The placeholder is replaced with a certain value when the string is displayed. Strings are stored in PHP array called $strings. The item key in this array is called ''string identifier'' or ''string name''. Examples:
== How do language packs work? ==
 
A standard Moodle comes with an English language pack only. It is installed in ''moodledata/lang/en.'' Extra language packs are normally installed directly from within Moodle from ''Administration>Language>Language packs'', but in some cases you might need to
install them via FTP to your moodledata folder into the folder ''lang''.
 
The English language terms (or 'strings')  for the main (core) Moodle features such as administration, roles etc, are stored in ''lang/en.'' Language files relating to modules, blocks and add-ons are stored with the files of that particular module, block or add-on. So if you wanted to see the language strings for the badges block for example, you would look in ''blocks/badges/lang/en''. If you wanted to see the language files for the workshop module, you would look in'' mod/workshop/lang/en''
 
 
If you install another languge pack, you will then get  a folder  such as ''lang/fr'' which would have French translations of Moodle terms. Unlike with English, other language  packs such as  ''lang/fr'' will contain all translations along with the main core terms so you would find see for example the badges strings in ''lang/fr/block_badges.php'' and the workshop strings in ''lang/fr/workshop.php''
 
These files (which all end in .php) contain short phrases, often called "strings". Strings may contain a placeholder (between the curly brackets below). This placeholder is replaced with the chosen words from the language pack when the string is displayed. The term between the square brackets is called the 'string identifier' or the 'string name'. Examples:


  $string['addnewcourse'] = 'Add a new course';
  $string['addnewcourse'] = 'Add a new course';
  $string['hidesection'] = 'Hide section {$a}';
  $string['hidesection'] = 'Hide section {$a}';
  $string['uploadedfileto'] = 'Uploaded {$a->file} to {$a->directory}';
   
 
If a string hasn't been translated, then Moodle will use the parent language or the original English version. Thus, you might see a Moodle site where some terms have been translated into a language but others still display in English.
 
==Non-translatable strings==
While AMOS does a great job for translating the Moodle core and most Moodle add-ons language strings, some English language strings are (as of July 2013) not yet available for translation with AMOS.
 
The plugins classified as '[https://moodle.org/plugins/browse.php?list=category&id=38 Other] ' are not translatable by AMOS (see [http://lang.moodle.org/mod/forum/discuss.php?d=3113 this forum thread]). You can use the [[Language customization]] tool within your Moodle (production or local) server to produce the .php file cointaining 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.
 
==Translating the Moodle online Documentation (MoodleDocs)==
[[MoodleDocs:About|MoodleDocs]] pages, such as the page you are reading right now, are wiki pages available in [https://docs.moodle.org/overview/ several languages]. Any registered Moodle user can contribute to MoodleDocs and improve or translate these wiki pages. Please make sure to follow the [[Guidelines_for_Contributors|guidelines for contributors]].
 
==Looking for translated add-ons in the Moodle plugins database==
* According to [http://lang.moodle.org/mod/forum/discuss.php?d=2485 http://lang.moodle.org/mod/forum/discuss.php?d=2485], almost all contributed plugins published in Moodle Plugins directory have been imported into [http://lang.moodle.org/ AMOS] and are ready to be translated.
* 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:


These strings definition can be then used by get_string() function (see lib/moodlelib.php). If a string doesn't exist in a particular language, Moodle tries to find it in the so called parent language. If there is no parent language defined or it does not define the requested string, then the equivalent in English will automatically be used instead.
[[File:Link to Plugin translations in Moodle plugins database.png|300px]]


Installation language packs may be found in the ''install/lang'' folder. These language packs contain only the strings needed for the installation process. The files are generated automatically and '''must not be changed manually'''. For translators this is a unusual experience, since changes you add to the strings used in the installation script will not be visible until our script is run and commits them into Moodle sources.
* 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 appropiate link.
* If you have a translator account at AMOS, you can use AMOS to contribute a 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.
* Make sure that you have selected the Moodle branch(es) that you are interested in (eg, 2.5 in the image below).


== Using the AMOS translation tool ==
[[File:Plugins translations in AMOS.png|400px]]


Just quick notes for now, to be elaborated more - please help to improve this documentation.  
* 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 thet 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.
* Please help Moodle users in other languages by translating your favorite plugins :)


Language pack maintainers can create an account at http://lang.moodle.org and email [mailto:translation@moodle.org translation@moodle.org] (Koen) to get their account activated for working for their language. The tool for collaborating on the translation work is not yet in place, so for now only language pack maintainers who have CVS editing rights will be granted access. Once the collaborating tool is ready, language pack maintainers will be able to review work from contributors before adding it to their language pack.  
==Are there translations for the American (and other branches of the) English language?==
* The [http://lang.moodle.org/mod/forum/discuss.php?d=2617 "official"] language for Moodle is actually the Australian English (''hey mate!'') , which in 100% the same as UK English.
* [http://english.stackexchange.com/questions/74737/what-is-the-origin-of-the-phrase-two-nations-divided-by-a-common-language Someone] once said "America and England are two nations divided by a common language".
* The [http://download.moodle.org/download.php/langpack/2.6/en_us.zip English - United States (en_us)] language pack mostly contains different spellings (color ''versus'' colour, etc).
* The [http://download.moodle.org/download.php/langpack/2.6/en_ar.zip English - Pirate (en_ar)] language pack is used in the '[https://moodle.org/mod/forum/discuss.php?d=132888 Talk Like a Pirate]' day.
* The [http://download.moodle.org/download.php/langpack/2.6/en_kids.zip English for kids (en_kids)] language pack seems to be a simplified version of the most common English strings seen by Moodle users, considered easier/suitable for small children.
* The [https://tracker.moodle.org/browse/MDLSITE-1363 English (fixes) (en_fix)] is exclusively used by [http://lang.moodle.org/ AMOS] translators to suggest fixes for typos found in the Moodle core language strings. See [https://docs.moodle.org/25/en/Translation_FAQ#I.27ve_found_an_error_in_the_English_language_pack._How_do_I_report_it.3F reporting a typo in the English language].


The workflow in AMOS is:
==See also==
* Use the Translator filter to show strings you want to work on
* [[Translation priority]] - a useful list (albeit incomplete) categorising the priority in which strings should be translated.
* Translate missing strings and/or update the translation
* [[Translation FAQ]]
* The translated strings are put into a temporary area called ''stage''
* [[dev:Translation langconfig|Settings in langconfig]]
* '''The stage is destroyed when you logout. You have to explicitly commit the stage so it is saved permanently!'''
* Language packages are generated every hour and published at http://download.moodle.org/langpack/2.0/
* Using AMOS, you can check for missing strings in older versions, but the strings are read-only. They get automatically pulled in AMOS from the CVS repository.


[[Category:Language]]
[[fr:Traduction]]
[[de:Übersetzung]]
[[es:Traducción]]

Latest revision as of 20:13, 3 November 2013

So you'd like to help with translating Moodle?

Great! :-) Please check the list of language packs without maintainer. If your language is listed, and you'd like to volunteer to become language pack maintainer, email our translation coordinator, Koen, translation@moodle.org.

Otherwise, check the Translation credits and contact the maintainer of your language pack to ask where you can help. The name at the top of the list for each language is the current language pack maintainer. (If you don't receive a response within a reasonable time, email Koen translation@moodle.org.)

Getting started

The Moodle languages portal http://lang.moodle.org/ enables translators to work collaboratively on language packs and submit translations using a special Moodle translation tool called AMOS.

To help with translating Moodle

  1. Create an account on the portal, making sure you provide your full name (in order for you to receive credit for your translation work) and contact email.
  2. See the info Help for newcomers.
  3. Access the AMOS translation tool via the link in the navigation block and see the AMOS documentation.
  4. Check the langconfig file first, before translating other files.

If you have any questions, please enrol in the Translating Moodle course and join the discussions there.

How do language packs work?

A standard Moodle comes with an English language pack only. It is installed in moodledata/lang/en. Extra language packs are normally installed directly from within Moodle from Administration>Language>Language packs, but in some cases you might need to install them via FTP to your moodledata folder into the folder lang.

The English language terms (or 'strings') for the main (core) Moodle features such as administration, roles etc, are stored in lang/en. Language files relating to modules, blocks and add-ons are stored with the files of that particular module, block or add-on. So if you wanted to see the language strings for the badges block for example, you would look in blocks/badges/lang/en. If you wanted to see the language files for the workshop module, you would look in mod/workshop/lang/en


If you install another languge pack, you will then get a folder such as lang/fr which would have French translations of Moodle terms. Unlike with English, other language packs such as lang/fr will contain all translations along with the main core terms so you would find see for example the badges strings in lang/fr/block_badges.php and the workshop strings in lang/fr/workshop.php

These files (which all end in .php) contain short phrases, often called "strings". Strings may contain a placeholder (between the curly brackets below). This placeholder is replaced with the chosen words from the language pack when the string is displayed. The term between the square brackets is called the 'string identifier' or the 'string name'. Examples:

$string['addnewcourse'] = 'Add a new course';
$string['hidesection'] = 'Hide section {$a}';

If a string hasn't been translated, then Moodle will use the parent language or the original English version. Thus, you might see a Moodle site where some terms have been translated into a language but others still display in English.

Non-translatable strings

While AMOS does a great job for translating the Moodle core and most Moodle add-ons language strings, some English language strings are (as of July 2013) not yet available for translation with AMOS.

The plugins classified as 'Other ' 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 cointaining 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.

Translating the Moodle online Documentation (MoodleDocs)

MoodleDocs pages, such as the page you are reading right now, are wiki pages available in several languages. Any registered Moodle user can contribute to MoodleDocs and improve or translate these wiki pages. Please make sure to follow the guidelines for contributors.

Looking for translated add-ons in the Moodle plugins database

  • According to http://lang.moodle.org/mod/forum/discuss.php?d=2485, almost all contributed plugins published in Moodle Plugins directory have been imported into AMOS and are ready to be translated.
  • 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 account in AMOS, you would have to 'Create a new account' by using the appropiate link.
  • If you have a translator account at AMOS, you can use AMOS to contribute a 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.
  • 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 thet 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.
  • Please help Moodle users in other languages by translating your favorite plugins :)

Are there translations for the American (and other branches of the) English language?

See also