pluralizationRules for Russian translation

This commit is contained in:
Anton Batenev 2013-06-12 20:04:40 +04:00
parent a104c37d63
commit 848bd01ecd
1 changed files with 7 additions and 0 deletions

View File

@ -1,3 +1,10 @@
//= depend_on 'client.ru.yml'
//= require locales/i18n
<%= JsLocaleHelper.output_locale(:ru) %>
I18n.pluralizationRules['ru'] = function (n) {
if (n == 0) return ["zero", "none", "other"];
if (n % 10 == 1 && n % 100 != 11) return "one";
if (n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20)) return "few";
return "many";
}