Note: You are currently viewing documentation for Moodle 2.0. Up-to-date documentation for the latest stable version is available here: Local language.
This page requires updating for Moodle 2.0. Please do so and remove this template when finished.
A "local language" is created after editing or adding to, the initially installed language pack. Site administrators should note the local languages are located in the Moodle data directory folder, for example the moodledata\lang directory.
The local language feature allows a user with permissions to make changes in strings that are part of a standard language pack, but these changes will not be overridden when the site and\or standard language pack is upgraded.
Behind the Moodle interface
One language installed - editing process
At the time of the initial Moodle install, the installer is asked to put in the default language. This places that language pack into the moodle\lang folder as a folder. For example the standard English language pack path would be moodle\lang\en_utf8.
moodle\lang\en_utf8 has 3 folders under it and files. When the user selects a file to edit (for example, the en_UTF8 language's access.php file), Moodle finds the default strings in the moodle\lang\en_utf8\access.php file.
As noted at the top, when they try to edit that file, Moodle creates a new folder in the Moodle directory (moodledata) site files with the same name as the parent with an "_local" folder and specific php file. For example, it will create a moodledata\lang\en_utf8_local\access.php file. Only those strings that are changed are placed in that file.
Additional languages added - editing process
When a user with permissions, adds a language pack after an initial install through the site administration block, this language pack is placed in the Moodle data directory (moodledata\lang) as if it is a local language. For example, when es_utf8 language pack is added, it's files are placed in a folder called moodledata\lang\es_utf8.
The en_utf8 will appear on the pulldown menu as a selection language to edit. When it is edited, a new folder will be created and called en_utf8_local. If a string in moodle.php was changed, it will appear in the "local" directory in a file called moodle.php.
- TIP: You can install individual language packs manually by downloading the zip file at moodle.org/lang16 to the local language directory and unzipping it there.
Moodle Help files are html files, located in a help sub directory in the language folder. The process is similar. When the user with permissions edits the HTML file, it is stored as a local language edit, in the usual "_local\help folder as an html file.
Tips and tricks
- Knowing where the language files are located can help with global replacements with a 3rd party program.
- Placing a renamed copy of the en_utf8 folder as en_moodle_utf8 in the moodledata\lang folder, essentially creates a new language that will not be impacted by upgrades. This would allow the site administrator to create a "special language" changes outside of the Moodle interface. By directly editing the files in the new language, these become the default strings, which someone else can edit. The edits get placed in a different folder in the local language area.