Translation: Difference between revisions
Darren Smith (talk | contribs) (Links still need doing from original file) |
Helen Foster (talk | contribs) (category, titles, formatting) |
||
Line 1: | Line 1: | ||
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. | 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 == | |||
* moodle.php - strings for main interface | Each language is a subdirectory of the directory ''lang''. | ||
* assignment.php - strings for assignment module | |||
* choice.php - strings for choice module | ''lang/en'' is the directory containing all files for English. | ||
* forum.php - strings for forum module | |||
* quiz.php - strings for quiz module | * ''moodle.php'' - strings for main interface | ||
* resource.php - strings for resource module | * ''assignment.php'' - strings for assignment module | ||
* survey.php - strings for survey 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. | * .... plus other modules if any. | ||
A string is called from these files using the <code>get_string()</code> or <code>print_string()</code> functions. Each string supports variable substitution, to support variable ordering in different languages. | |||
e.g. <code>$strdueby = get_string("assignmentdueby", "assignment", userdate($date));</code> | |||
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. <code>helpbutton("text", "Click here for help about text");</code> , and for modules, <code>helpbutton("forumtypes", "Forum types", "forum");</code> | |||
== Language editing == | |||
Please note that you may edit languages via Administration >> Configuration >> [[Admin/lang | 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 [http://moodle.org/mod/forum/view.php?id=43 Using Moodle: Languages] forum. | |||
[[Category:Developer]] | |||
Revision as of 07:11, 20 December 2005
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.