Skip to content

Commit

Permalink
Fixed broken lithuanian translation
Browse files Browse the repository at this point in the history
This closes #4301.

Signed-off-by: Kevin Brown <kevin@kevin-brown.com>
  • Loading branch information
aurelijusrozenas authored and kevin-brown committed Apr 24, 2016
1 parent 5a831af commit 5b5eddd
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/js/select2/i18n/lt.js
Original file line number Diff line number Diff line change
@@ -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;
} else {
return third;
}
// 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 first;
return other;
}
}

Expand All @@ -18,7 +16,7 @@ define(function () {

var message = 'Pašalinkite ' + overChars + ' simbol';

message += ending(overChars, '', 'ius', 'į');
message += ending(overChars, 'į', 'ius', '');

return message;
},
Expand All @@ -27,7 +25,7 @@ define(function () {

var message = 'Įrašykite dar ' + remainingChars + ' simbol';

message += ending(remainingChars, '', 'ius', 'į');
message += ending(remainingChars, 'į', 'ius', '');

return message;
},
Expand All @@ -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;
},
Expand Down

0 comments on commit 5b5eddd

Please sign in to comment.