How to translate Claroline?
From ClarolineDoc
| Table of contents |
How does it work?
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.
For each language you will find the following files :
- complete.lang.php : all translated strings are there
- install.lang.php : all translated strings for installation of Claroline are there (may not exist if not translated at all)
- missing.lang.php : strings from complete.lang.php that are not translated yet
- missing.install.lang.php : strings from install.lang.php that are not translated yet
- locale_settings.php : defines how times and dates should be displayed, days and months names, iso codes, charset
How to proceed to translate Claroline?
General instructions
How to edit a translation file
To translate Claroline, you just need:
- The latest release of your language translation (get it from the latest available Claroline release or from the Claroline website (http://www.claroline.net/dlarea/translate/))
- A good text editor or better : phpLangEditor, a new translation tool that has been developed specifically for Claroline by Sébastien Piraux. Take a look at this editor. It may greatly simplify your translation task.
Warning : 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.
- In each language file you only have to modify the part similar to "translated text" in the following example
$_lang['text to translate or key'] = 'Translated text'; Becomes in French : $_lang['text to translate or key'] = 'Texte traduit';
- Outer quotes must remains but if you have text with inner quotes you must escape them with \ (backslash). See for example :
$_lang['Access control management'] = 'Gestion du contrôle d\'accès';
- The charset in which you edit the file must be the same as the one specified in locale_settings.php of the language you are translating.
How to test a translation
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).
- Create a course in the language you are currently translating. Alternatively you can change the language of an existing course in the course properties.
- Regularly update the complete.lang.php file you are working on by adding the newly translated variables and refresh your browser to see your changes.
- To test the translation of the Claroline installer simply run the installer and choose the correct language at the first step.
How to submit a translation
Once your translation work is done, send the translated files to the following address : info@claroline.net. After a specific process, the Claroline development team will make it available in the next Claroline release.
Translating the software in a new language
To translate Claroline in a language :
- Create a new directory in claroline/lang and name it with the new language's name.
- Grab the empty language files from the Claroline website (http://www.claroline.net/dlarea/translate/new_language.zip)
- Extract the files to the language new directory
- Open the copied file with your favorite translation tool and replace the English text by the appropriate language translation.
- Change the locale settings file locale_settings.php for the new language
- Test the translation (http://doc.claroline.net/en/index.php/How_to_translate_Claroline%3F#How_to_test_a_translation)
- Submit your translation (http://doc.claroline.net/en/index.php/How_to_translate_Claroline%3F#How_to_submit_a_translation)
Once your translation work is done, send the translated files 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 missing.lang.php file from the language you are completing in your favorite translation tool and translate the missing strings (http://doc.claroline.net/en/index.php/How_to_translate_Claroline%3F#How_to_edit_a_translation_file).
- Fill up complete.lang.php with the missing translation items you have translated by copying the corresponding lines (from the Dollar character to the semi-colon included) into the complete.lang.php file.
- Test the translation (http://doc.claroline.net/en/index.php/How_to_translate_Claroline%3F#How_to_test_a_translation)
- Submit your translation (http://doc.claroline.net/en/index.php/How_to_translate_Claroline%3F#How_to_submit_a_translation)
Translating the installer
- Open the missing.install.lang.php file from the language you are completing in your favorite translation tool and translate the missing strings (http://doc.claroline.net/en/index.php/How_to_translate_Claroline%3F#How_to_edit_a_translation_file).
- Fill up install.lang.php with the missing translation items you have translated by copying the corresponding lines (from the Dollar character to the semi-colon included) into the install.lang.php file.
- Test the translation (http://doc.claroline.net/en/index.php/How_to_translate_Claroline%3F#How_to_test_a_translation)
- Submit your translation (http://doc.claroline.net/en/index.php/How_to_translate_Claroline%3F#How_to_submit_a_translation)

