Hi, I happen to be i18nspector upstream.
Wow! What a quick response, thank you :)

- i18nspector and Transifex (the service we use for our translation)
heavily disagree about how a po-file should look like,
Care to elaborate on how they "heavily disagree"?
I "only" refer to the pluralization form.

and how Russion plurals work(?!).
The Russian PO file reads:

Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 &&
n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9)
|| (n%100>=11 && n%100<=14)? 2 : 3);
This is copied verbatim from the Transifex service. I'm not competent 
enough in Russian to dare touching it. This discussion seems to lead to 
a bug in Transifex itself. I'll contact Transifex about this, linking to 
this discussion.
Even though I don't speak Russian, I can tell that this Plural-Forms
can't possibly be correct. Here 4 plural forms are declared, but the
expression never evaluates to 3.
Since it's just modular arithmetic, one can just parse the formula to 
fill out a 10x10 table as a "proof". I did that, and came to the same 
result as you do, without even looking at your program. (Originally I 
assumed a precedence error / parsing issue / whatever, so I didn't want 
to start reading C code ... sorry.)
For the record, here's my interpretation, with parenthesis added:

((n%10==1 && n%100!=11)
 ? 0
 : ((n%10>=2 && n%10<=4 && (n%100<12 || n%100>14))
    ? 1
    : ((n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14))
       ? 2
       : 3)))

This rule can be written in regex as follows (note that there is an implicit "and not any of the above", although it doesn't make a difference):
- "[023456789]1" => "Transifex one"
- "[023456789][234]" => "Transifex few"
- "1.|.[056789]" => "Transifex many"
- else => "Transifex other"

In this form, it's rather easy to verify that "Transifex other" never happens. The names of the forms are based on what Transifex calls them.
I'm too lazy to make a mathematical proof that this the case, so instead
I wrote a small program that demonstrates it. Please see the attachment.
Let me know if the program ever stops. :-P
I'm going to recommend http://haroldbot.cloudapp.net/ for this, even 
though it fails with "Something went wrong" for all queries related to 
this. I have no idea why.
Now, it would be cool if i18nspector explained better what is wrong
here. [snip]  I hope to implement this in the future.
Sounds awesome! However, I was still able to understand that *something* 
about the expression was fishy, but didn't understand that i18nspector 
is able to detect issues like this. (Doesn't that essentially require a 
SAT-solver?)
([snip] other issues that need no response from my side.)

Regards,
Ben Wiederhake
PS: Juhani Numminen, I haven't ignored your mail, but my response to your mail is going to take longer. Sorry, and thanks for your detailed feedback!


Reply via email to