1
0
mirror of synced 2024-11-22 21:16:10 +03:00

Fixed broken lithuanian translation

This closes https://github.com/select2/select2/issues/4301.

Signed-off-by: Kevin Brown <kevin@kevin-brown.com>
This commit is contained in:
Aurelijus Rožėnas 2016-04-12 14:28:52 +03:00 committed by Kevin Brown
parent 5a831afb9a
commit 5b5eddd183

View File

@ -1,14 +1,12 @@
define(function () { define(function () {
// Italian // rules from http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html#lt
function ending (count, first, second, third) { function ending(count, one, few, other) {
if ((count % 100 > 9 && count % 100 < 21) || count % 10 === 0) { if (count % 10 === 1 && (count % 100 < 11 || count % 100 > 19)) {
if (count % 10 > 1) { return one;
return second; } else if ((count % 10 >= 2 && count % 10 <= 9) && (count % 100 < 11 || count % 100 > 19)) {
} else { return few;
return third;
}
} else { } else {
return first; return other;
} }
} }
@ -18,7 +16,7 @@ define(function () {
var message = 'Pašalinkite ' + overChars + ' simbol'; var message = 'Pašalinkite ' + overChars + ' simbol';
message += ending(overChars, 'ių', 'ius', '); message += ending(overChars, 'į', 'ius', 'ių');
return message; return message;
}, },
@ -27,7 +25,7 @@ define(function () {
var message = 'Įrašykite dar ' + remainingChars + ' simbol'; var message = 'Įrašykite dar ' + remainingChars + ' simbol';
message += ending(remainingChars, 'ių', 'ius', '); message += ending(remainingChars, 'į', 'ius', 'ių');
return message; return message;
}, },
@ -37,7 +35,7 @@ define(function () {
maximumSelected: function (args) { maximumSelected: function (args) {
var message = 'Jūs galite pasirinkti tik ' + args.maximum + ' element'; var message = 'Jūs galite pasirinkti tik ' + args.maximum + ' element';
message += ending(args.maximum, 'ų', 'us', '); message += ending(args.maximum, 'ą', 'us', ');
return message; return message;
}, },