2013-05-30 01:53:40 -04:00
|
|
|
MessageFormat.locale.ru = function (n) {
|
2014-08-23 08:28:14 -04:00
|
|
|
var r10 = n % 10, r100 = n % 100;
|
|
|
|
|
|
|
|
if (r10 == 1 && r100 != 11)
|
2013-05-30 01:53:40 -04:00
|
|
|
return 'one';
|
2014-08-23 08:28:14 -04:00
|
|
|
|
|
|
|
if (r10 >= 2 && r10 <= 4 && (r100 < 12 || r100 > 14) && n == Math.floor(n))
|
2013-05-30 01:53:40 -04:00
|
|
|
return 'few';
|
2014-08-23 08:28:14 -04:00
|
|
|
|
2022-12-14 12:56:46 -05:00
|
|
|
if (r10 === 0 || (r10 >= 5 && r10 <= 9) ||
|
|
|
|
(r100 >= 11 && r100 <= 14) && n == Math.floor(n)) {
|
|
|
|
return 'many';
|
|
|
|
}
|
|
|
|
|
2013-05-30 01:53:40 -04:00
|
|
|
return 'other';
|
|
|
|
};
|