Currently, all things and figures in Freeciv that should be named in messages have only one string that is used as their name. Nations have two strings, name and adjective, but they are mostly translated as the same, probably because no one can get the idea when each one is used (I judge by Russian translation). This sometimes might lead to broken language even in English; if we have a message "Your %s has not enough movepoints left to perform %s now", the first %s is good for "Spy" but requires "have" verb for "Archers", and _PL() function can't help here. Also, we would like at the end "establish trade route" better than "perform Establish Trade Route". There are gender languages, as French, where we might sometimes mind if our Spy is female or male. CivIV XML files have gender and number specifications for each translation of each unit name. But there are case languages, say Russian, where you must inflect nouns and adjectives depending on their role in the sentence and the words they are related with.
How message writers get around now: in Russian, all messages mentioning units and nations do it after words, correspondingly, "soyedineniye" and "narod" used in the appropriate form in the message. Using the nominative case for the noun in this context is more or less plausible Russian but very far from excellent.
I don't know any particular gettext extension that can cope with this problem. I can only imagine how it would look. Say, in the message table we have
"Your <%s [has]> not enough movepoints left to <[?p:v=|perform] %s> now"
that is translated to Russian as
"У <[c=g][ваш] %s> недостаточно очков движения, чтобы сейчас <[?p:v=|выполнить[c=a] ]%s>"
For the units and actions, we have in English
"Archer[s]"
"Sp[y][g=f]" ;gender for "he/she/they" in some msgs
"establish[ING] trade route<[?Nroutes:sg|pl=[N=Nroutes]|[N=sg]][S]>[p=v]"
"bombardment[S][p=n]"
and in Russian
"Лучни[ки][a=a][g=m]"
"Шпион[Ы][a=a][g=m]"
"установ[ить] <[?Nroutes:sg|pl=[N=Nroutes]|[N=sg]]торгов[ый] [путь]>[p=v]"
"бомбардиров[о?][ка][p=n]"
The flexion definitions would contain for English langpack
Code: Select all
has=[!N:sg][!t:PresI][t:i=have|Past*=had|G=having|[?N:pl=have|has]]
s=[!N:pl][?N:pl=s]
S=[!N:sg][?N:pl=s]
y=[!N:sg][?N:pl=ies|y]
ING=[!t:i][?t:*C|G=ing]
Code: Select all
V=(Ci:аоуыэяёюие)
к=[!N:sg][!g:m][?N:sg=[?c:g=ка|d=ку|a=[?a:a=ка|к]|i=ком|p|l=ке|к]|[ки]]
ка=[!N:sg][!g:f][?N:sg=[?c:g=ки|d=ке|a=ку|i=кой|p|l=ке|ка]|[ки]]
ки=[!N:pl][?N:sg=[?g:f=[ка]|n=[ко]|[к]|[?c:g=ков|d=кам|a=[?a:a=ков|ки]|i=ками|p|l=ках|ки]]
ы=[!N:pl][?N:sg=[?g:f=[а]|n=[о]|[Ы]]|[?c:g=[?d:1=|ов]|d=ам|a=[?g:m=[?a:a=ов|ы]|ы]|i=ами|p|l=ах|ы]]
Ы=[!N:sg][!g:m][!d:2][?N:pl=[ы]|[?c:g=а|d=у|a=[?a:a=а|]|i=ом|p|l=е]]
ить=[!t:i][?t:Past=ил[?N:pl=и|[?g:f=а|n=о]]|i=ить|Imp=[?@-1:/(Ci:[V])/=й|и][?N:sg=|те]|[!pe:3][?pe:2=[?N=sg:ишь|ите]|1=[?N:pl=им|[?@-1:б|в|м|п|ф=л]ю]|[?N=pl:ят|ит]]]
ый=[!N:sg][!g:m][?N:pl=[?c:g=ых|d=ым|a=[?g:m=[?a:a=ых|ые]|ые]|i=ыми|p|l=ых|ые]|[?g:f=[?c:g|d|i|p|l=ой|a=ую|ая]|[?c:g=ого|d=ому|a=[?g:m=[?a:a=ого|ый]|ое]|i=ым|p|l=ом|[?g:n=ое|ый]]]]
путь=[!N:sg][!g:m]<[d=3]пут[?N:sg=[?c:i=ём|[ь]]|[ь]]>[!a:i]
ь=[!N:sg][?N:pl=[?c:g=ей|d=ям|a=[?g:m=[?a:a=я|ь]|ь]|i=ями|p|l=ях|и]|[?g:m=[!d:2]|f=[!d:3]][?d:3=[?c:g|d|p|l=и|i=ью|ь]|[?c:g=я|d=ю|a=[?a:a=я|ь]|i=[ё]м|p|l=е|ь]]]
о?=[@+/\w*/:/[V]/=|о]