|
|||
| Moderated by: Renate.Reinartz, Markus.Kreisel, Jaakko.Salmenius, Ilkka.Salmenius |
|
||||||||||||||||
| Plural forms for GetText - Wish list for software localization tool - Technical Support (You need to be registered at the forum to write) - .NET, Delphi, ... - Sisulizer Localization Tool Support | |||||||||||||||||
| Author | Post | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|||||||||||||||||
|
AntonM Member
|
Are going to add support of plurals in GetText? I mean specifying different forms of nouns for different numbers.
|
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Jaakko.Nieminen Administrator
|
Can you describe me a little bit about the above format? What does following mean? msgstr[0] Instead of 0 there can be any positive number. What does it mean? Jaakko
|
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
Jaakko.Nieminen Administrator
|
I found PO documentation and it contains info about it. It seems very complex. I have to study it little bit more. Jaakko
|
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Jaakko.Nieminen Administrator
|
Hi Anton I implemented plural forms scanning. Take a look at this screenshot. It contains a PO file that has one message string "%d file" / "%d files". When Sisulizer scans it it adds four rows to the project (marked as red). The first one matches the first plural index (0), second one the second (1), etc. In addition of this Sisulizer add a special plural forms row (marked as green). It contains the C expresison that maps the n to index. In my sample I have Finnish. It uses the same logic as English. So only first and second row is actually used. If you translate to Russian you can enter Russian expression nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2; that maps n into three different groups. So in that case you enter translation into third column (blue). If you translate into Slovenian that uses four different groups you must enter translation into the last row as well. This feature will be in the next build. Jaakko Attachment: Untitled.png (Downloaded 11 times)
|
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
AntonM Member
|
Hi Jaakko That's great! Thank you very much! One small improvements can be done (I believe easily): Number of rows for plural forms should depend on nplurals value. Anton Last edited on Mon Jul 19th, 2010 11:50 am by AntonM |
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Jaakko.Nieminen Administrator
|
It is not as easy as it look like. If the project contained only one language then we could use your idea. However if the project contains two or more languages that use different plural forms. For example if I have German and Slovenian as target languages. German uses two forms and Slovenian four forms. This is why Sisulizer need four rows to accomodate the needs of the most complex language. I added the number of plural forms in the properties of the PO file. You can set it to be any number between 2 and 6. use 2 if the is only Western language, 3 if there is also Slavic languages, 4 if there is also Slovenian and 6 if there is Arabic. The current data structure does not allow varian number translations. I added this to to TODO list for the next major Sisulizer version. Jaakko
|
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
AntonM Member
|
Many thanks for detailed explanation, Jaakko!
|
||||||||||||||||
| |||||||||||||||||
| Current time is 08:27 am | |
| .NET, Delphi, ... - Sisulizer Localization Tool Support > Technical Support (You need to be registered at the forum to write) > Wish list for software localization tool > Plural forms for GetText | |
Sisulizer software localization tool - Three simple steps to localize