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