forked from select2/select2
/
lt.js
55 lines (46 loc) · 1.43 KB
/
lt.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
define(function () {
// 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 other;
}
}
return {
inputTooLong: function (args) {
var overChars = args.input.length - args.maximum;
var message = 'Pašalinkite ' + overChars + ' simbol';
message += ending(overChars, 'į', 'ius', 'ių');
return message;
},
inputTooShort: function (args) {
var remainingChars = args.minimum - args.input.length;
var message = 'Įrašykite dar ' + remainingChars + ' simbol';
message += ending(remainingChars, 'į', 'ius', 'ių');
return message;
},
loadingMore: function () {
return 'Kraunama daugiau rezultatų…';
},
maximumSelected: function (args) {
var message = 'Jūs galite pasirinkti tik ' + args.maximum + ' element';
message += ending(args.maximum, 'ą', 'us', 'ų');
return message;
},
noResults: function () {
return 'Atitikmenų nerasta';
},
searching: function () {
return 'Ieškoma…';
},
removeAllItems: function () {
return 'Pašalinti visus elementus';
}
};
});