Translation: Difference between revisions

From MoodleDocs
m (New page: {{Moodle 2.0}} == Moodle 1.x == The following text described the process of Moodle translation for version 2.0 and higher. For Moodle 1.x, please follow Translation. == Summary of c...)
 
 
(62 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{Moodle 2.0}}
{{Translation}}


== Moodle 1.x ==
==So you'd like to help with translating Moodle?==


The following text described the process of Moodle translation for version 2.0 and higher. For Moodle 1.x, please follow [[Translation]].
Great! :-) All translation of Moodle LMS  and the plugins happens on our '''[http://lang.moodle.org Moodle translation site]''', so you'll need to start by creating an account there.


== Summary of changes since 1.x ==
Perhaps you've found some words or phrases not yet translated into your language? Or you've spotted a mistake? If so, please see the guide to [[Contributing a translation]].  


* translations are not in CVS any more but in a database at http://lang.moodle.org
Note: If you'd like to help translate more than just a few strings, please contact the maintainer of your language pack as listed in the [http://lang.moodle.org/local/amos/credits.php Translation credits] and ask where you can help.
* 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 do not have _utf8 suffix any more
* HTML help files were replaced with normal strings with _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 ==
Did you end up here, wanting to translate the [https://moodle.academy Moodle Academy courses], please start at [[Translating Moodle Academy]]


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''.
==Wish to take on responsibility for a language pack?==


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 Workshop module would be stored in ''moodledata/lang/cs/workshop.php'' and grading related strings in ''moodledata/lang/cs/grades.php'' (note the difference against the English strings).
Please see [[Maintaining a language pack]] and the [[AMOS manual]]  for further information about the AMOS translation toolkit.


The language files are all with .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 actually printed. Strings are stored in PHP array called $strings. The item key in this array is called ''string identifier'' or ''string name''. Examples:
==Is Moodle not yet translated into your language?==


  $string['addnewcourse'] = 'Add a new course';
Please see [[Starting a new language pack]].
$string['hidesection'] = 'Hide section {$a}';
$string['uploadedfileto'] = 'Uploaded {$a->file} to {$a->directory}';


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 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.
==Any questions?==


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.
Please check the [[Translation  FAQ]] and join us in the [http://lang.moodle.org/mod/forum/view.php?id=5 Using AMOS forum].


----


TODO: help with how to use AMOS portal to translate strings into your langauge
[[fr:Traduction]]
[[de:Übersetzung]]
[[es:Traducción]]
[[category:Language]]

Latest revision as of 10:08, 5 August 2022


So you'd like to help with translating Moodle?

Great! :-) All translation of Moodle LMS and the plugins happens on our Moodle translation site, so you'll need to start by creating an account there.

Perhaps you've found some words or phrases not yet translated into your language? Or you've spotted a mistake? If so, please see the guide to Contributing a translation.

Note: If you'd like to help translate more than just a few strings, please contact the maintainer of your language pack as listed in the Translation credits and ask where you can help.

Did you end up here, wanting to translate the Moodle Academy courses, please start at Translating Moodle Academy

Wish to take on responsibility for a language pack?

Please see Maintaining a language pack and the AMOS manual for further information about the AMOS translation toolkit.

Is Moodle not yet translated into your language?

Please see Starting a new language pack.

Any questions?

Please check the Translation FAQ and join us in the Using AMOS forum.