When I enable Portuguese Language on my site, "0 votes" in poll nodes seems to be translated as "1 vote". I checked the string translation and everything seems fine... I have "%count votes" translated as "%count votos" and "1 vote" translated as "1 voto".
Why then does "0 votes" get turned into "1 voto" when Portuguese language is enabled? Seems like a bug.
See here for an example: http://www.abreojogo.com/node/226
Also, I can't be 100% sure of this, but %members seems to suffer the same problem. In the the "who's online" block I think "0 members" gets incorrectly translated into "1 membro".
Comments
Comment #1
killes@www.drop.org commentedI think the formula used to determine correct plural forms might be wrong. The formula is taken from the PO file during the upgrade and it is stored inside the locales_meta table.
Comment #2
ricmadeira commentedThanks Killes!
On that table I have plurals=2 and formula=($n>1). I just don't known what that means... but I'll try to check the documentation.
Should we change this bug to the Portuguese Translation project then?
Comment #3
killes@www.drop.org commentedMoving.
$n > 1 should probably be changed to $n != 0 && $n > 1.
Comment #4
ricmadeira commentedGreat! It was really the plural formula, thanks!
I changed it to formula=(n!=1) and that seemed to do the trick. The number 0 is plural in Portuguese too.
Now I just have to check if this is correct in the portuguese.po file before closing the bug or submiting it there.
Comment #5
ricmadeira commentedOops, crossposted with Killes and doing so changed the bug back to the drupal Project. Moving back to the Portuguese translation.
Okay, so the code line "Plural-Forms: nplurals=2; plural=(n > 1);\n" in the portuguese.po file needs to be changed.
Which is better? "$n != 1" or what Killes suggested?
Comment #6
ricmadeira commentedComment #7
mcduarte2000 commentedI'll look at this and correct it. Thanks for the feedback.
Comment #8
mcduarte2000 commentedComment #9
(not verified) commented