Support forum of the software localization tool Sisulizer


.NET, Delphi, ... - Sisulizer Localization Tool Support Home

Get in contact with the makers of Sisulizer.
Our forum is open for all questions around Sisulizer from customers and prospects.
Don't hesitate to register and ask. The Sisulizer team will answer ASAP.

Search     Help Home Sisulizer Website Download
Search by username
Not logged in - Login | Register 

 Moderated by: Renate.Reinartz, Markus.Kreisel, Jaakko.Salmenius, Ilkka.Salmenius
New Topic Reply Printer Friendly
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
AuthorPost
 Posted: Fri Jul 16th, 2010 12:36 pm
PM Private Upload Quote Reply
AntonM
Member
 

Joined: Mon Jul 12th, 2010
Location:  
Posts: 17
Status: 
Offline
Are going to add support of plurals in GetText?
I mean specifying different forms of nouns for different numbers.
msgid "%d day ago"
msgid_plural "%d days ago"
msgstr[0] "%d день назад"
msgstr[1] "%d дня назад"
msgstr[2] "%d дней назад"
Anton

Back To Top PM Private Upload Quote Reply

 Posted: Fri Jul 16th, 2010 12:49 pm
PM Private Upload Quote Reply
Jaakko.Nieminen
Administrator
 

Joined: Sat Mar 20th, 2010
Location:  
Posts: 657
Status: 
Offline
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

Back To Top PM Private Upload Quote Reply

 Posted: Fri Jul 16th, 2010 01:06 pm
PM Private Upload Quote Reply
Jaakko.Nieminen
Administrator
 

Joined: Sat Mar 20th, 2010
Location:  
Posts: 657
Status: 
Offline
I found PO documentation and it contains info about it. It seems very complex. I have to study it little bit more.

Jaakko

Back To Top PM Private Upload Quote Reply

 Posted: Sat Jul 17th, 2010 05:56 am
PM Private Upload Quote Reply
Jaakko.Nieminen
Administrator
 

Joined: Sat Mar 20th, 2010
Location:  
Posts: 657
Status: 
Offline
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)

Back To Top PM Private Upload Quote Reply

 Posted: Mon Jul 19th, 2010 11:48 am
PM Private Upload Quote Reply
AntonM
Member
 

Joined: Mon Jul 12th, 2010
Location:  
Posts: 17
Status: 
Offline
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

Back To Top PM Private Upload Quote Reply

 Posted: Mon Jul 19th, 2010 12:19 pm
PM Private Upload Quote Reply
Jaakko.Nieminen
Administrator
 

Joined: Sat Mar 20th, 2010
Location:  
Posts: 657
Status: 
Offline
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

Back To Top PM Private Upload Quote Reply

 Posted: Mon Jul 19th, 2010 12:42 pm
PM Private Upload Quote Reply
AntonM
Member
 

Joined: Mon Jul 12th, 2010
Location:  
Posts: 17
Status: 
Offline
Many thanks for detailed explanation, Jaakko!

Back To Top PM Private Upload Quote Reply

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



WowUltra modified by Sisulizer Copyright © 2007-09 by Jim Hale - Based on WowBB Copyright © 2003-2006 Aycan Gulez

Sisulizer software localization tool - Three simple steps to localize