1
0
mirror of synced 2024-11-22 13:06:08 +03:00

Croatian l10n improved

This commit is contained in:
Uriy Efremochkin 2014-01-08 14:43:05 +06:00
parent 4e524f7308
commit d322d62396

View File

@ -1,42 +1,22 @@
/**
* Select2 Croatian translation.
*
* Author: Edi Modrić <edi.modric@gmail.com>
* @author Edi Modrić <edi.modric@gmail.com>
* @author Uriy Efremochkin <efremochkin@uriy.me>
*/
(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";
},
formatInputTooShort: function (input, min) { return "Unesite još" + character(min - input.length); },
formatInputTooLong: function (input, max) { return "Unesite" + character(input.length - max) + " manje"; },
formatSelectionTooBig: function (limit) { return "Maksimalan broj odabranih stavki je " + limit; },
formatLoadMore: function (pageNumber) { return "Učitavanje rezultata..."; },
formatSearching: function () { return "Pretraga..."; }
});
function character (n) {
return " " + n + " znak" + (n%10 < 5 && n%10 > 0 && (n%100 < 5 || n%100 > 19) ? n%10 > 1 ? "a" : "" : "ova");
}
})(jQuery);