Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: Translation.

Translation

From MoodleDocs
Revision as of 07:11, 20 December 2005 by Helen Foster (talk | contribs) (category, titles, formatting)

Moodle has been designed for internationalisation. Each 'string' or 'page' of text that is displayed as part of the interface is drawn from a set of language files.

Directory structure of lang

Each language is a subdirectory of the directory lang.

lang/en is the directory containing all files for English.

  • moodle.php - strings for main interface
  • assignment.php - strings for assignment module
  • choice.php - strings for choice module
  • forum.php - strings for forum module
  • quiz.php - strings for quiz module
  • resource.php - strings for resource module
  • survey.php - strings for survey module
  • .... plus other modules if any.

A string is called from these files using the get_string() or print_string() functions. Each string supports variable substitution, to support variable ordering in different languages.

e.g. $strdueby = get_string("assignmentdueby", "assignment", userdate($date));

If a string doesn't exist in a particular language, then the equivalent in English will automatically be used instead.

  • lang/en/help contains whole help pages for pop-up context-sensitive help.

Main help pages are situated here, while help pages specific to each module are located in subdirectories with the module's name.

Help buttons

You may insert a help button in a page with the helpbutton function.

e.g. helpbutton("text", "Click here for help about text"); , and for modules, helpbutton("forumtypes", "Forum types", "forum");

Language editing

Please note that you may edit languages via Administration >> Configuration >> Language. This makes it easy to not only create new languages but to refine existing ones. If you are starting a new language, please contact Martin Dougiamas. You may also like to post in the Using Moodle: Languages forum.