discourse/lib/javascripts/locale/sr.js
blokovi 364e6fdd53 FIX: pluralization rules for Serbian language (#5453)
Updated SR pluralization to use 3 keys: one, few, other (as by Transifex)
2017-12-22 12:20:19 +01:00

11 lines
244 B
JavaScript

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