11define ( function ( ) {
2- // Italian
3- function ending ( count , first , second , third ) {
4- if ( ( count % 100 > 9 && count % 100 < 21 ) || count % 10 === 0 ) {
5- if ( count % 10 > 1 ) {
6- return second ;
7- } else {
8- return third ;
9- }
2+ // rules from http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html#lt
3+ function ending ( count , one , few , other ) {
4+ if ( count % 10 === 1 && ( count % 100 < 11 || count % 100 > 19 ) ) {
5+ return one ;
6+ } else if ( ( count % 10 >= 2 && count % 10 <= 9 ) && ( count % 100 < 11 || count % 100 > 19 ) ) {
7+ return few ;
108 } else {
11- return first ;
9+ return other ;
1210 }
1311 }
1412
@@ -18,7 +16,7 @@ define(function () {
1816
1917 var message = 'Pašalinkite ' + overChars + ' simbol' ;
2018
21- message += ending ( overChars , 'ių ' , 'ius' , 'į ' ) ;
19+ message += ending ( overChars , 'į ' , 'ius' , 'ių ' ) ;
2220
2321 return message ;
2422 } ,
@@ -27,7 +25,7 @@ define(function () {
2725
2826 var message = 'Įrašykite dar ' + remainingChars + ' simbol' ;
2927
30- message += ending ( remainingChars , 'ių ' , 'ius' , 'į ' ) ;
28+ message += ending ( remainingChars , 'į ' , 'ius' , 'ių ' ) ;
3129
3230 return message ;
3331 } ,
@@ -37,7 +35,7 @@ define(function () {
3735 maximumSelected : function ( args ) {
3836 var message = 'Jūs galite pasirinkti tik ' + args . maximum + ' element' ;
3937
40- message += ending ( args . maximum , 'ų ' , 'us' , 'ą ' ) ;
38+ message += ending ( args . maximum , 'ą ' , 'us' , 'ų ' ) ;
4139
4240 return message ;
4341 } ,
0 commit comments