Gettext » History » Version 15

moyo, 06/13/2012 11:10 PM

1 13 moyo
h1. Gettext / Translation 
2 13 moyo
3 13 moyo
h2. For translators
4 13 moyo
5 13 moyo
Since version 0.84, GLPI use gettext as localization. We use transifex for manage translations.
6 13 moyo
The project page is here : https://www.transifex.net/projects/p/GLPI/
7 13 moyo
You could register to transifex and request to join a translation team.
8 15 moyo
To discussed about translation also register to glpi-translation mailing-list : http://www.glpi-project.org/spip.php?article57
9 13 moyo
10 13 moyo
Gettext solution permit to manage :
11 13 moyo
* variable strings : strings may contains variable informations such as name or number. Example : "ID %s" to display ID 12. When several variables are used, they are ordered for manage RTL language. For example : "%1$s adds the item %2$s"
12 13 moyo
* plural : various plural forms are used depending of the language. Gettext permit to have a clean management of them.
13 13 moyo
* context : a string may have several meanings depending of the context. Gettext permit to have 2 translations for a same string when developer used context. In transifex, you could see context information in Details / Description
14 13 moyo
* RTL : gettext will permit to have a clean management of RTL languages (arabic...). Now, the RTL management is not complete but strings with parameters may have a RTL translation. Example : "%1$s %2$s" may be translated to "%2$s %1$s" (invert informations)
15 13 moyo
16 13 moyo
h3. Localisation scheme :
17 13 moyo
18 13 moyo
* Developpers add new strings to GLPI source code using standard functions (__(), __s(), _n()...), managing plurals and context.
19 13 moyo
* New strings are extract to a gettext template file (pot file) and send to transifex. New strings are proposed to translation.
20 13 moyo
* Translations are extracted from transifex as po file and convert to binary mo file used by GLPI. 
21 13 moyo
22 13 moyo
23 13 moyo
h2. For developpers
24 1 moyo
25 4 moyo
* Strings with troubles with solution:
26 4 moyo
** Transfer the verb / Transfer the noun: Do not use the verb. Or add To Transfer
27 10 remi
*** Remi : create a "button" context for all verb ?
28 11 moyo
*** MoYo : good idea when a solution for contexts will be founded
29 4 moyo
** Software singular / Software plural: use _n('Software','Software',$nb)
30 4 moyo
31 4 moyo
* String with troubles without solution (for the moment):
32 3 remi
** in search::showList() // Create title  => generated string
33 5 remi
** Very High, High, Medium, Low, Very Low => various translation in french for genre (impact, priority, urgency). Proposal, use" impact/low" as msgid, "Low" as msgstr (english), with a comment for translation team
34 8 moyo
*** Moyo : Must be done with gettext context... But Zend do not permit using them.
35 9 remi
*** Remi : Nor php
36 11 moyo
*** MoYo : but problem using PHP extension (server prerequisites = all locales installed). See internal mail.
37 12 remi
** "General" : $LANG['help'][30], $LANG['setup'][139], $LANG['setup'][703]  (genre : Général/Générale)
38 7 remi
39 7 remi
* Other TODO
40 1 moyo
** in showSystemInformations, lang is forced to en_GB, so probably no need to use gettext there.
41 8 moyo
*** MoYo : Yesssss
42 9 remi
*** Remi : done :)