[xmoto-dev] Plural forms and %s for non Germanic family languages

[ Thread Index | Date Index | More lists.tuxfamily.org/xmoto-dev Archives ]


Hi people,

note that your po is impacted now by some news.

X-Moto has been translated in Germanic languages from the beginning.
What happend when somebody want to translate X-Moto in a non Germanic language ? (thanks to Jānis for these informations, you can now finish Latvian translation i think)

In french for example, we have 2 plurals forms like in english.
1 or >1 :
1 apple
2, 3, ... apples

=== according to documentation,
In Polish we use e.g. plik (file) this way:

         1 plik
         2,3,4 pliki
         5-21 pliko'w
         22-24 pliki
         25-31 pliko'w
===


Moreover, in some languages, words order is not the same :
In french or english you can say :
"Ghost of Nicolas" but in some other languages, order is not the same.

=>
Then i had to change the po so that xmoto can allow this :

1) first at the top of you po file, you must tell how are your plural form ; in french line in germanic languages, you've just to add in the header :
"Plural-Forms: nplurals=2; plural=n>1;"
just see http://viewvc.tuxfamily.org/svn_xmoto_xmoto/trunk/po/fr_FR.po?view=markup

if you don't know what to put, just see the documentation where all is explain, mainly, for each language family, you'll found what to put :
http://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html

2) Then, i added a new text to translate, example :

#: src/GameText.h:134 src/GameText.h:300
msgid "Player"
msgid_plural "Players"
msgstr[0] "Joueur"
msgstr[1] "Joueurs"

=> the english ids:
msgid "Player"
msgid_plural "Players"

the translation of the different forms :
msgstr[0] "Joueur" => this is the singular form in french
msgstr[1] "Joueurs" => this is the plural form in french

if your lang is more complex, just ask me.

3) for words order, i just modified the strings, keep %s %i or anything like it is ; in the following example, %s will be replaced in the game by the name of the player
msgid "Ghost of %s"
msgstr "Fantôme de %s"

as you can imagine, i could write :
msgid "Ghost of %s"
msgstr "%s fantôme"

except it would not be correct in french

If you've any question, just ask me.

Nicolas





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/