Lang howto

Thursday, 10. February 2005 00:28:18, by David Jobet


How to add a new lang ?

We have to distinguish two things here.

New lang content

To allow the content to be translated in a new lang, you only have to ask the administrator to create the lang in the admin panel. You will then have the possibility to choose the lang in your preferences.
The pros is that the wiki will show you this lang in priority and will switch back to the wiki's site wide lang only if the content does not exist in the lang you have chosen.

The UI

To have the UI being translated in a new lang, you will have to ask the admin to add a new i18n lang file that contains the translation of all the strings.
If the translation does not exist, you can speed up things by creating it yourself.
You can retrieve an existing lang file (wiclear distribution contain fr.lang files), rename it to the lang you want to translate (say es.lang) and effectively edit the file to translate all strings.

The syntax is as follows :

[english string]
translated string
[english string]
translated string

If you want to keep up to date with development version, you can try the script create_translation_template.pl.
Launch the following command :

 $> cd wiclear/i18n
 $> ../scripts/create_translation_template.pl ../inc ../themes

The script will collect all source strings, and will create new lang files containing old translated strings plus new untranslated strings and will try to reconciliate modified strings (those entry will be marked as fuzzy)