Does this need a bug report? Not clear if you can change this on Weblate.
The current plural rule in the .po file reads…
"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2;\n"
…but it should be…
"Plural-Forms: nplurals=5; plural=(n==1 ? 0 : n==2 ? 1 : n>=3 && n<=6 ? 2 : "
"n>=7 && n<=10 ? 3 : 4);\n"
1 Like
Thanks for letting us know. I have fixed this in commit 855707, and the change is now visible in Weblate.
You will need to check and update 56 strings with plurals, which can be found by searching using the “has:plural” filter.
1 Like
Thanks.
Now that I’ve looked at it in practice, it seems that although this is the approved Unicode rule, it’s not right. There should be 6 options.
I don’t know how to translate it into the rule syntax, but the categories should be:
Simplified System (I think this is what Unicode is trying to follow)
- zero: 0
- one: 1 / 11
- two: 2 / 12
- few: 3-6 / 13-16
- many: 7-10 / 17-19
- other: everything else (20+)
Traditional System
- zero: 0
- one: 1
- two: 2
- few: 3-6 and any number ending in 3-6
- many: 7-10 and any number ending in 7-9
- other: everything else
Both system are allowed in the Official Standard.
The rule for the simplified system will be:
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 || n==11 ? 1 : n==2 || n==12 ? 2 : (n>=3 && n<=6) || (n>=13 && n<=16) ? 3 : (n>=7 && n<=10) || (n>=17 && n<=19) ? 4: 5;\n"
and for the traditional system:
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%10>=3 && n%10<=6 ? 3 : (n%10>=7 && n%10<=9) || n==10 ? 4 : 5;\n"
Which system do you want to use?