Note: You are currently viewing documentation for Moodle 3.4. Up-to-date documentation for the latest stable version of Moodle is likely available here: Language packs.

Language packs: Difference between revisions

From MoodleDocs
(→‎See also: Adding MoodleBites YouTube video link)
(Inside a language pack moved from dev:Translation)
Line 27: Line 27:
* The English language pack is updated automatically each time the site is upgraded.
* The English language pack is updated automatically each time the site is upgraded.
* As most language packs are a work in progress, it is usually a good idea to update them regularly. Once a week/month might be a good frequency.
* As most language packs are a work in progress, it is usually a good idea to update them regularly. Once a week/month might be a good frequency.
==Inside a language pack==
A standard Moodle comes with an English language pack only. It is installed in ''moodledata/lang/en.''
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 other plugins are stored with the files of that particular plugin. 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 language 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.


==See also==
==See also==
Line 32: Line 47:
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=48492 Language import utility broken] forum discussion
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=48492 Language import utility broken] forum discussion
* List of [http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes language codes] on Wikipedia
* List of [http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes language codes] on Wikipedia
* [[Translation]] and help us to translate Moodle to more languages
* [[:dev:Translation]] and help us to translate Moodle to more languages
*[http://youtu.be/0v72GKn2Wuk Moodle 2 Language Administration settings]  MoodleBites video on YouTube   
*[http://youtu.be/0v72GKn2Wuk Moodle 2 Language Administration settings]  MoodleBites video on YouTube   


Line 40: Line 55:
[[ja:言語インポートユーティリティ]]
[[ja:言語インポートユーティリティ]]
[[de:Sprachpakete]]
[[de:Sprachpakete]]
[[zh:语言倒入工具]]

Revision as of 13:56, 28 July 2014

Over 100 language packs are available for an administrator to install on your Moodle site via Administration > Site administration > Language > Language packs. Simply select the languages you require from the list of available language packs and click on the "Install selected language pack" button.

Multiple language packs may be selected for install by holding down the Apple or Ctrl key whilst clicking on the language packs.

Installing many (20+) language packs has almost 0 impact on Moodle performance.

All language packs, apart from English, are stored in moodledata/lang folder.

Parent language packs

Certain language packs contain only the modified language strings from their parent language, rather than a complete set. Thus, it is necessary to install the parent language pack too. These language packs are:

  • de_du, de_kids and de_comm (which requires de)
  • fr_ca (which requires fr)
  • en_us, en_ar, en_kids (which requires the default en)

Manual language pack installation

Language packs may also be installed manually by downloading the zip file from http://download.moodle.org/langpack/ to a directory called lang in your moodledata directory and then unzipping.

Language pack updates

  • Language packs can be updated via Administration > Site administration > Language > Language packs.
  • You can see which language packs have updates because they are listed in both 'Installed language packs' and 'Available language packs'.
  • To update all installed language packs (except English and any local language packs) click the 'Update all installed language packs' button.
  • For sites with a large number of language packs installed, to update just a few installed language packs at a time, select the languages from the 'Available language packs' list and click the 'Install selected language pack(s)' button.
  • The English language pack is updated automatically each time the site is upgraded.
  • As most language packs are a work in progress, it is usually a good idea to update them regularly. Once a week/month might be a good frequency.

Inside a language pack

A standard Moodle comes with an English language pack only. It is installed in moodledata/lang/en.

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 other plugins are stored with the files of that particular plugin. 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 language 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.

See also