forked from select2/select2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
select2_locale_hr.js
42 lines (36 loc) · 1.46 KB
/
select2_locale_hr.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
/**
* Select2 Croatian translation.
*
* Author: Edi Modrić <[email protected]>
*/
(function ($) {
"use strict";
var specialNumbers = {
1: function(n) { return (n % 100 != 11 ? "znak" : "znakova"); },
2: function(n) { return (n % 100 != 12 ? "znaka" : "znakova"); },
3: function(n) { return (n % 100 != 13 ? "znaka" : "znakova"); },
4: function(n) { return (n % 100 != 14 ? "znaka" : "znakova"); }
};
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "Nema rezultata"; },
formatInputTooShort: function (input, min) {
var n = min - input.length;
var nMod10 = n % 10;
if (nMod10 > 0 && nMod10 < 5) {
return "Unesite još " + n + " " + specialNumbers[nMod10](n);
}
return "Unesite još " + n + " znakova";
},
formatInputTooLong: function (input, max) {
var n = input.length - max;
var nMod10 = n % 10;
if (nMod10 > 0 && nMod10 < 5) {
return "Unesite " + n + " " + specialNumbers[nMod10](n) + " manje";
}
return "Unesite " + n + " znakova manje";
},
formatSelectionTooBig: function (limit) { return "Maksimalan broj odabranih stavki je " + limit; },
formatLoadMore: function (pageNumber) { return "Učitavanje rezultata..."; },
formatSearching: function () { return "Pretraga..."; }
});
})(jQuery);