implement pluralization for server-side and js

This commit is contained in:
Kuba Brecka
2013-03-31 19:55:02 +02:00
parent 5bf3a0eaf3
commit af0a772629
5 changed files with 126 additions and 1 deletions

View File

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