FIX: pluralization rules for Serbian language (#5453)

Updated SR pluralization to use 3 keys: one, few, other (as by Transifex)
This commit is contained in:
blokovi
2017-12-22 12:20:19 +01:00
committed by Gerhard Schlager
parent d80aca0484
commit 364e6fdd53
2 changed files with 8 additions and 11 deletions

View File

@ -1,14 +1,11 @@
MessageFormat.locale.sr = function (n) {
if ((n % 10) == 1 && (n % 100) != 11) {
var r10 = n % 10, r100 = n % 100;
if (r10 == 1 && r100 != 11)
return 'one';
}
if ((n % 10) >= 2 && (n % 10) <= 4 &&
((n % 100) < 12 || (n % 100) > 14) && n == Math.floor(n)) {
if (r10 >= 2 && r10 <= 4 && (r100 < 12 || r100 > 14) && n == Math.floor(n))
return 'few';
}
if ((n % 10) === 0 || ((n % 10) >= 5 && (n % 10) <= 9) ||
((n % 100) >= 11 && (n % 100) <= 14) && n == Math.floor(n)) {
return 'many';
}
return 'other';
};
};