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 21:55, 24 August 2005 by Darren Smith (talk | contribs) (Links still need doing from original file)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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. Each language is a subdirectory of the directory 'lang'. The structure of the lang directory is as follows:

lang/en - directory containing all files for one language (eg 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.
eg $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 popup 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.
You can insert a helpbutton in a page with the helpbutton function.
eg helpbutton("text", "Click here for help about text");
and for modules:
helpbutton("forumtypes", "Forum types", "forum");

Note that you can edit languages online, using the administration web tools under "Check this language". This makes it easy to not to only create new languages but to refine existing ones. If you are starting a new language, please contact me, Martin Dougiamas.

You might also like to post in the Languages forum on Using Moodle. If you are maintaining a language an ongoing basis, I can give you CVS write access to the Moodle source code so that you can directly maintain the files.