How to translate Claroline?
From ClarolineDoc
| Table of contents |
Translation system
How does it work?
The translation system of Claroline may be managed in two modes : the TRANSLATION mode or the PRODUCTION mode. By default, Alpha, Beta and Candidate releases are set to TRANSLATION mode and stable release are set to PRODUCTION.
- In TRANSLATION mode, all translation texts for a specific language are retrieved from a huge centralised language data file (claroline/lang/your_langage/ complete.lang.php). This greatly facilitates the work of translators as they no longer have to translate the same item more than once, wherever it appears in the software. However, the downside of it is the performance : the system has to load a huge file at each user request and it takes a lot of memory and execution time.
- In PRODUCTION mode, the translation texts are split into smaller files by the system for each one of the plateform's tools. These files contain a lot of redundant text, which makes them less appropriate for the translators' work. However, because they are very small, they load fast and do not slow the software's execution time.
When switching from the TRANSLATION mode to the PRODUCTION mode, the centralised language data file is stored in the system's database and specific scripts written by the Claroline team process it in order to build the collection of smaller files used in PRODUCTION mode.
To change from PRODUCTION mode to TRANSLATION mode : * Login your Claroline platform as administrator, * Click on Administration. * Click on Configuration. * Click on Main settings. * Find the Language mode option, and select Translation. * Click on the save button.
How to proceed to translate Claroline?
To translate Claroline, you just need:
- The latest release of your language translation (download it from Nightly Page (http://cvs.claroline.net/exports/nightlyBuild/lang_1_8/))
- A good text editor or better : phpLangEditor, a new translation tool editor that has been developed specifically for Claroline by Sébastien Piraux (aka Fragile). Take a look at this editor. It may greatly simplify your translation task.
Note : Microsoft Word is a word processor not a text editor. Whatever its powerful formatting features, it is not fit for managing the file format used with Claroline. Using Emacs, or even Microsoft Notepad or any other text editor is more appropriate.
Translating the software in a new language
All the language translation files are stored in the claroline/lang directory. Under this directory, each language has its own directory, named after the language's name. If you want to translate Claroline in a new language :
- Create a new directory in claroline/lang and name it with the new language's name.
- Copy the claroline/lang/english/complete.lang.php file into the new directory.
- Open the copied file with your text editor and replace the English text by the appropriate language translation.
Note : Each translation sentence looks like : $lang_translation_item = "Translation text"; Don't change anything but the text inside the quotes.
Once your translation work is done, send the complete.lang.php file to the following address : info@claroline.net. After a specific process, the Claroline development team will make the new language translation available in the next Claroline release.
Completing an existing translation
- Open the claroline/your_language/complete.lang.php file in a text editor and make any change needed to the existing translation texts.
Note : complete.lang.php may contain multiple tokens of the same translation item with different translations. You can remove the unappropriate line(s). In case of multiple tokens of a translation item, only the last one is taken into account.
- Fill up complete.lang.php with the missing translation items. You will find these items in claroline/your_language/missing.lang.php. Change the English text by the appropriate translation and copy the line (from the Dollar character to the semi-colon included) into complete.lang.php file.
Once your translation work is done, send the complete.lang.php file to the following address : info@claroline.net. After a specific process, the Claroline development team will make it available in the next Claroline release.
How to check the translation result in real time?
You can check the result of your translation work in real time if you are writing into the files of a correctly installed Claroline (see Claroline installation).
You just have to :
- Set the main language of the Claroline platform to the one you are currently translating (see Platform Administration).
- Check that Claroline is in language TRANSLATION mode .
- Regularly save the complete.lang.php file you are working on and refresh your browser to see your changes.

