diff --git a/select2.js b/select2.js index 2320df74..fa4d21a7 100644 --- a/select2.js +++ b/select2.js @@ -3425,14 +3425,6 @@ the specific language governing permissions and limitations under the Apache Lic }, formatResultCssClass: function(data) {return data.css;}, formatSelectionCssClass: function(data, container) {return undefined;}, - formatMatches: function (matches) { if (matches === 1) { return "One result is available, press enter to select it."; } return matches + " results are available, use up and down arrow keys to navigate."; }, - formatNoMatches: function () { return "No matches found"; }, - formatAjaxError: function (jqXHR, textStatus, errorThrown) { return "Loading failed"; }, - formatInputTooShort: function (input, min) { var n = min - input.length; return "Please enter " + n + " or more character" + (n == 1? "" : "s"); }, - formatInputTooLong: function (input, max) { var n = input.length - max; return "Please delete " + n + " character" + (n == 1? "" : "s"); }, - formatSelectionTooBig: function (limit) { return "You can only select " + limit + " item" + (limit == 1 ? "" : "s"); }, - formatLoadMore: function (pageNumber) { return "Loading more results…"; }, - formatSearching: function () { return "Searching…"; }, minimumResultsForSearch: 0, minimumInputLength: 0, maximumInputLength: null, @@ -3471,6 +3463,21 @@ the specific language governing permissions and limitations under the Apache Lic } }; + $.fn.select2.locales = []; + + $.fn.select2.locales['en'] = { + formatMatches: function (matches) { if (matches === 1) { return "One result is available, press enter to select it."; } return matches + " results are available, use up and down arrow keys to navigate."; }, + formatNoMatches: function () { return "No matches found"; }, + formatAjaxError: function (jqXHR, textStatus, errorThrown) { return "Loading failed"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Please enter " + n + " or more character" + (n == 1 ? "" : "s"); }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Please delete " + n + " character" + (n == 1 ? "" : "s"); }, + formatSelectionTooBig: function (limit) { return "You can only select " + limit + " item" + (limit == 1 ? "" : "s"); }, + formatLoadMore: function (pageNumber) { return "Loading more results…"; }, + formatSearching: function () { return "Searching…"; }, + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['en']); + $.fn.select2.ajaxDefaults = { transport: $.ajax, params: { diff --git a/select2_locale_ar.js b/select2_locale_ar.js index acb33a2f..f9fbaa16 100644 --- a/select2_locale_ar.js +++ b/select2_locale_ar.js @@ -6,12 +6,14 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['ar'] = { formatNoMatches: function () { return "لم يتم العثور على مطابقات"; }, formatInputTooShort: function (input, min) { var n = min - input.length; if (n == 1){ return "الرجاء إدخال حرف واحد على الأكثر"; } return n == 2 ? "الرجاء إدخال حرفين على الأكثر" : "الرجاء إدخال " + n + " على الأكثر"; }, formatInputTooLong: function (input, max) { var n = input.length - max; if (n == 1){ return "الرجاء إدخال حرف واحد على الأقل"; } return n == 2 ? "الرجاء إدخال حرفين على الأقل" : "الرجاء إدخال " + n + " على الأقل "; }, formatSelectionTooBig: function (limit) { if (n == 1){ return "يمكنك أن تختار إختيار واحد فقط"; } return n == 2 ? "يمكنك أن تختار إختيارين فقط" : "يمكنك أن تختار " + n + " إختيارات فقط"; }, formatLoadMore: function (pageNumber) { return "تحميل المزيد من النتائج…"; }, formatSearching: function () { return "البحث…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['ar']); })(jQuery); diff --git a/select2_locale_bg.js b/select2_locale_bg.js index 585d28a2..3283d0ae 100644 --- a/select2_locale_bg.js +++ b/select2_locale_bg.js @@ -7,12 +7,14 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['bg'] = { formatNoMatches: function () { return "Няма намерени съвпадения"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "Моля въведете още " + n + " символ" + (n > 1 ? "а" : ""); }, formatInputTooLong: function (input, max) { var n = input.length - max; return "Моля въведете с " + n + " по-малко символ" + (n > 1 ? "а" : ""); }, formatSelectionTooBig: function (limit) { return "Можете да направите до " + limit + (limit > 1 ? " избора" : " избор"); }, formatLoadMore: function (pageNumber) { return "Зареждат се още…"; }, formatSearching: function () { return "Търсене…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['bg']); })(jQuery); diff --git a/select2_locale_ca.js b/select2_locale_ca.js index 7e19d3ce..dbea39e9 100644 --- a/select2_locale_ca.js +++ b/select2_locale_ca.js @@ -6,12 +6,14 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['ca'] = { formatNoMatches: function () { return "No s'ha trobat cap coincidència"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "Introduïu " + n + " caràcter" + (n == 1 ? "" : "s") + " més"; }, formatInputTooLong: function (input, max) { var n = input.length - max; return "Introduïu " + n + " caràcter" + (n == 1? "" : "s") + "menys"; }, formatSelectionTooBig: function (limit) { return "Només podeu seleccionar " + limit + " element" + (limit == 1 ? "" : "s"); }, formatLoadMore: function (pageNumber) { return "S'estan carregant més resultats…"; }, formatSearching: function () { return "S'està cercant…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['ca']); })(jQuery); diff --git a/select2_locale_cs.js b/select2_locale_cs.js index 376b54a1..ef121856 100644 --- a/select2_locale_cs.js +++ b/select2_locale_cs.js @@ -12,7 +12,7 @@ 3: function() { return "tři"; }, 4: function() { return "čtyři"; } } - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['cs'] = { formatNoMatches: function () { return "Nenalezeny žádné položky"; }, formatInputTooShort: function (input, min) { var n = min - input.length; @@ -45,5 +45,7 @@ }, formatLoadMore: function (pageNumber) { return "Načítají se další výsledky…"; }, formatSearching: function () { return "Vyhledávání…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['cs']); })(jQuery); diff --git a/select2_locale_da.js b/select2_locale_da.js index dbce3e17..702238b9 100644 --- a/select2_locale_da.js +++ b/select2_locale_da.js @@ -6,12 +6,14 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['da'] = { formatNoMatches: function () { return "Ingen resultater fundet"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "Angiv venligst " + n + " tegn mere"; }, formatInputTooLong: function (input, max) { var n = input.length - max; return "Angiv venligst " + n + " tegn mindre"; }, formatSelectionTooBig: function (limit) { return "Du kan kun vælge " + limit + " emne" + (limit === 1 ? "" : "r"); }, formatLoadMore: function (pageNumber) { return "Indlæser flere resultater…"; }, formatSearching: function () { return "Søger…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['da']); })(jQuery); diff --git a/select2_locale_de.js b/select2_locale_de.js index ee971ac4..e2754172 100644 --- a/select2_locale_de.js +++ b/select2_locale_de.js @@ -4,7 +4,7 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['de'] = { formatNoMatches: function () { return "Keine Übereinstimmungen gefunden"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "Bitte " + n + " Zeichen mehr eingeben"; }, formatInputTooLong: function (input, max) { var n = input.length - max; return "Bitte " + n + " Zeichen weniger eingeben"; }, @@ -12,5 +12,7 @@ formatLoadMore: function (pageNumber) { return "Lade mehr Ergebnisse…"; }, formatSearching: function () { return "Suche…"; }, formatMatches: function (matches) { return matches + " Ergebnis " + (matches > 1 ? "se" : "") + " verfügbar, zum Navigieren die Hoch-/Runter-Pfeiltasten verwenden."; } - }); -})(jQuery); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['de']); +})(jQuery); \ No newline at end of file diff --git a/select2_locale_el.js b/select2_locale_el.js index e94b02cb..d17459e1 100644 --- a/select2_locale_el.js +++ b/select2_locale_el.js @@ -6,12 +6,14 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['el'] = { formatNoMatches: function () { return "Δεν βρέθηκαν αποτελέσματα"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "Παρακαλούμε εισάγετε " + n + " περισσότερο" + (n > 1 ? "υς" : "") + " χαρακτήρ" + (n > 1 ? "ες" : "α"); }, formatInputTooLong: function (input, max) { var n = input.length - max; return "Παρακαλούμε διαγράψτε " + n + " χαρακτήρ" + (n > 1 ? "ες" : "α"); }, formatSelectionTooBig: function (limit) { return "Μπορείτε να επιλέξετε μόνο " + limit + " αντικείμεν" + (limit > 1 ? "α" : "ο"); }, formatLoadMore: function (pageNumber) { return "Φόρτωση περισσότερων…"; }, formatSearching: function () { return "Αναζήτηση…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['el']); })(jQuery); \ No newline at end of file diff --git a/select2_locale_en.js.template b/select2_locale_en.js.template index 9a65edd6..f758b110 100644 --- a/select2_locale_en.js.template +++ b/select2_locale_en.js.template @@ -6,7 +6,7 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['en'] = { formatMatches: function (matches) { if (matches === 1) { return "One result is available, press enter to select it."; } return matches + " results are available, use up and down arrow keys to navigate."; }, formatNoMatches: function () { return "No matches found"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "Please enter " + n + " or more character" + (n == 1 ? "" : "s"); }, @@ -14,5 +14,7 @@ formatSelectionTooBig: function (limit) { return "You can only select " + limit + " item" + (limit == 1 ? "" : "s"); }, formatLoadMore: function (pageNumber) { return "Loading more results…"; }, formatSearching: function () { return "Searching…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['en']); })(jQuery); diff --git a/select2_locale_es.js b/select2_locale_es.js index f2b58179..b506fbcd 100644 --- a/select2_locale_es.js +++ b/select2_locale_es.js @@ -4,12 +4,14 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['es'] = { formatNoMatches: function () { return "No se encontraron resultados"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "Por favor, introduzca " + n + " car" + (n == 1? "ácter" : "acteres"); }, formatInputTooLong: function (input, max) { var n = input.length - max; return "Por favor, elimine " + n + " car" + (n == 1? "ácter" : "acteres"); }, formatSelectionTooBig: function (limit) { return "Sólo puede seleccionar " + limit + " elemento" + (limit == 1 ? "" : "s"); }, formatLoadMore: function (pageNumber) { return "Cargando más resultados…"; }, formatSearching: function () { return "Buscando…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['es']); })(jQuery); diff --git a/select2_locale_et.js b/select2_locale_et.js index a4045d22..4d69f55e 100644 --- a/select2_locale_et.js +++ b/select2_locale_et.js @@ -6,12 +6,14 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['et'] = { formatNoMatches: function () { return "Tulemused puuduvad"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "Sisesta " + n + " täht" + (n == 1 ? "" : "e") + " rohkem"; }, formatInputTooLong: function (input, max) { var n = input.length - max; return "Sisesta " + n + " täht" + (n == 1? "" : "e") + " vähem"; }, formatSelectionTooBig: function (limit) { return "Saad vaid " + limit + " tulemus" + (limit == 1 ? "e" : "t") + " valida"; }, formatLoadMore: function (pageNumber) { return "Laen tulemusi.."; }, formatSearching: function () { return "Otsin.."; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['et']); })(jQuery); diff --git a/select2_locale_eu.js b/select2_locale_eu.js index 1da1a709..67ae8d05 100644 --- a/select2_locale_eu.js +++ b/select2_locale_eu.js @@ -6,7 +6,7 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['eu'] = { formatNoMatches: function () { return "Ez da bat datorrenik aurkitu"; }, @@ -39,5 +39,7 @@ formatSearching: function () { return "Bilatzen…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['eu']); })(jQuery); diff --git a/select2_locale_fa.js b/select2_locale_fa.js index a9e95af4..b3ffd8b7 100644 --- a/select2_locale_fa.js +++ b/select2_locale_fa.js @@ -7,7 +7,7 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['fa'] = { formatMatches: function (matches) { return matches + " نتیجه موجود است، کلیدهای جهت بالا و پایین را برای گشتن استفاده کنید."; }, formatNoMatches: function () { return "نتیجه‌ای یافت نشد."; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "لطفاً " + n + " نویسه بیشتر وارد نمایید"; }, @@ -15,5 +15,7 @@ formatSelectionTooBig: function (limit) { return "شما فقط می‌توانید " + limit + " مورد را انتخاب کنید"; }, formatLoadMore: function (pageNumber) { return "در حال بارگیری موارد بیشتر…"; }, formatSearching: function () { return "در حال جستجو…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['fa']); })(jQuery); diff --git a/select2_locale_fi.js b/select2_locale_fi.js index 9bed310f..6487fbda 100644 --- a/select2_locale_fi.js +++ b/select2_locale_fi.js @@ -3,7 +3,7 @@ */ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['fi'] = { formatNoMatches: function () { return "Ei tuloksia"; }, @@ -24,5 +24,7 @@ formatSearching: function () { return "Etsitään…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['fi']); })(jQuery); diff --git a/select2_locale_fr.js b/select2_locale_fr.js index 110854f8..d5485d6b 100644 --- a/select2_locale_fr.js +++ b/select2_locale_fr.js @@ -4,7 +4,7 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['fr'] = { formatMatches: function (matches) { return matches + " résultats sont disponibles, utilisez les flèches haut et bas pour naviguer."; }, formatNoMatches: function () { return "Aucun résultat trouvé"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "Saisissez " + n + " caractère" + (n == 1? "" : "s") + " supplémentaire" + (n == 1? "" : "s") ; }, @@ -12,5 +12,7 @@ formatSelectionTooBig: function (limit) { return "Vous pouvez seulement sélectionner " + limit + " élément" + (limit == 1 ? "" : "s"); }, formatLoadMore: function (pageNumber) { return "Chargement de résultats supplémentaires…"; }, formatSearching: function () { return "Recherche en cours…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['fr']); })(jQuery); diff --git a/select2_locale_gl.js b/select2_locale_gl.js index 80326320..9335167d 100644 --- a/select2_locale_gl.js +++ b/select2_locale_gl.js @@ -6,7 +6,7 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['gl'] = { formatNoMatches: function () { return "Non se atoparon resultados"; }, @@ -39,5 +39,7 @@ formatSearching: function () { return "Buscando…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['gl']); })(jQuery); diff --git a/select2_locale_he.js b/select2_locale_he.js index 00385410..789dcdca 100644 --- a/select2_locale_he.js +++ b/select2_locale_he.js @@ -6,12 +6,14 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['he'] = { formatNoMatches: function () { return "לא נמצאו התאמות"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "נא להזין עוד " + n + " תווים נוספים"; }, formatInputTooLong: function (input, max) { var n = input.length - max; return "נא להזין פחות " + n + " תווים"; }, formatSelectionTooBig: function (limit) { return "ניתן לבחור " + limit + " פריטים"; }, formatLoadMore: function (pageNumber) { return "טוען תוצאות נוספות…"; }, formatSearching: function () { return "מחפש…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['he']); })(jQuery); diff --git a/select2_locale_hr.js b/select2_locale_hr.js index c2937252..ce8051c7 100644 --- a/select2_locale_hr.js +++ b/select2_locale_hr.js @@ -7,14 +7,16 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['hr'] = { formatNoMatches: function () { return "Nema rezultata"; }, 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…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['hr']); function character (n) { return " " + n + " znak" + (n%10 < 5 && n%10 > 0 && (n%100 < 5 || n%100 > 19) ? n%10 > 1 ? "a" : "" : "ova"); diff --git a/select2_locale_hu.js b/select2_locale_hu.js index a8c30881..f431f246 100644 --- a/select2_locale_hu.js +++ b/select2_locale_hu.js @@ -4,12 +4,14 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['hu'] = { formatNoMatches: function () { return "Nincs találat."; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "Túl rövid. Még " + n + " karakter hiányzik."; }, formatInputTooLong: function (input, max) { var n = input.length - max; return "Túl hosszú. " + n + " karakterrel több, mint kellene."; }, formatSelectionTooBig: function (limit) { return "Csak " + limit + " elemet lehet kiválasztani."; }, formatLoadMore: function (pageNumber) { return "Töltés…"; }, formatSearching: function () { return "Keresés…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['hu']); })(jQuery); diff --git a/select2_locale_id.js b/select2_locale_id.js index 54745407..e9c1fd9b 100644 --- a/select2_locale_id.js +++ b/select2_locale_id.js @@ -6,12 +6,14 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['id'] = { formatNoMatches: function () { return "Tidak ada data yang sesuai"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "Masukkan " + n + " huruf lagi" + (n == 1 ? "" : "s"); }, formatInputTooLong: function (input, max) { var n = input.length - max; return "Hapus " + n + " huruf" + (n == 1 ? "" : "s"); }, formatSelectionTooBig: function (limit) { return "Anda hanya dapat memilih " + limit + " pilihan" + (limit == 1 ? "" : "s"); }, formatLoadMore: function (pageNumber) { return "Mengambil data…"; }, formatSearching: function () { return "Mencari…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['id']); })(jQuery); diff --git a/select2_locale_is.js b/select2_locale_is.js index aecc6cd7..273f33de 100644 --- a/select2_locale_is.js +++ b/select2_locale_is.js @@ -4,12 +4,14 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['is'] = { formatNoMatches: function () { return "Ekkert fannst"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "Vinsamlegast skrifið " + n + " staf" + (n > 1 ? "i" : "") + " í viðbót"; }, formatInputTooLong: function (input, max) { var n = input.length - max; return "Vinsamlegast styttið texta um " + n + " staf" + (n > 1 ? "i" : ""); }, formatSelectionTooBig: function (limit) { return "Þú getur aðeins valið " + limit + " atriði"; }, formatLoadMore: function (pageNumber) { return "Sæki fleiri niðurstöður…"; }, formatSearching: function () { return "Leita…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['is']); })(jQuery); diff --git a/select2_locale_it.js b/select2_locale_it.js index d4e24de7..6e2b8e23 100644 --- a/select2_locale_it.js +++ b/select2_locale_it.js @@ -4,12 +4,14 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['it'] = { formatNoMatches: function () { return "Nessuna corrispondenza trovata"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "Inserisci ancora " + n + " caratter" + (n == 1? "e" : "i"); }, formatInputTooLong: function (input, max) { var n = input.length - max; return "Inserisci " + n + " caratter" + (n == 1? "e" : "i") + " in meno"; }, formatSelectionTooBig: function (limit) { return "Puoi selezionare solo " + limit + " element" + (limit == 1 ? "o" : "i"); }, formatLoadMore: function (pageNumber) { return "Caricamento in corso…"; }, formatSearching: function () { return "Ricerca…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['it']); })(jQuery); \ No newline at end of file diff --git a/select2_locale_ja.js b/select2_locale_ja.js index 81106e78..7dbd8d7e 100644 --- a/select2_locale_ja.js +++ b/select2_locale_ja.js @@ -4,12 +4,14 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['ja'] = { formatNoMatches: function () { return "該当なし"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "後" + n + "文字入れてください"; }, formatInputTooLong: function (input, max) { var n = input.length - max; return "検索文字列が" + n + "文字長すぎます"; }, formatSelectionTooBig: function (limit) { return "最多で" + limit + "項目までしか選択できません"; }, formatLoadMore: function (pageNumber) { return "読込中・・・"; }, formatSearching: function () { return "検索中・・・"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['ja']); })(jQuery); diff --git a/select2_locale_ka.js b/select2_locale_ka.js index 366cc2d9..6cbe1d8f 100644 --- a/select2_locale_ka.js +++ b/select2_locale_ka.js @@ -6,12 +6,14 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['ka'] = { formatNoMatches: function () { return "ვერ მოიძებნა"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "გთხოვთ შეიყვანოთ კიდევ " + n + " სიმბოლო"; }, formatInputTooLong: function (input, max) { var n = input.length - max; return "გთხოვთ წაშალოთ " + n + " სიმბოლო"; }, formatSelectionTooBig: function (limit) { return "თქვენ შეგიძლიათ მხოლოდ " + limit + " ჩანაწერის მონიშვნა"; }, formatLoadMore: function (pageNumber) { return "შედეგის ჩატვირთვა…"; }, formatSearching: function () { return "ძებნა…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['ka']); })(jQuery); diff --git a/select2_locale_ko.js b/select2_locale_ko.js index 1a84d21e..bf036e09 100644 --- a/select2_locale_ko.js +++ b/select2_locale_ko.js @@ -6,12 +6,14 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['ko'] = { formatNoMatches: function () { return "결과 없음"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "너무 짧습니다. "+n+"글자 더 입력해주세요."; }, formatInputTooLong: function (input, max) { var n = input.length - max; return "너무 깁니다. "+n+"글자 지워주세요."; }, formatSelectionTooBig: function (limit) { return "최대 "+limit+"개까지만 선택하실 수 있습니다."; }, formatLoadMore: function (pageNumber) { return "불러오는 중…"; }, formatSearching: function () { return "검색 중…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['ko']); })(jQuery); diff --git a/select2_locale_lt.js b/select2_locale_lt.js index 2e2f950b..7d7040f7 100644 --- a/select2_locale_lt.js +++ b/select2_locale_lt.js @@ -7,7 +7,7 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['lt'] = { formatNoMatches: function () { return "Atitikmenų nerasta"; }, formatInputTooShort: function (input, min) { return "Įrašykite dar" + character(min - input.length); }, formatInputTooLong: function (input, max) { return "Pašalinkite" + character(input.length - max); }, @@ -16,7 +16,9 @@ }, formatLoadMore: function (pageNumber) { return "Kraunama daugiau rezultatų…"; }, formatSearching: function () { return "Ieškoma…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['lt']); function character (n) { return " " + n + " simbol" + ((n%100 > 9 && n%100 < 21) || n%10 == 0 ? "ių" : n%10 > 1 ? "ius" : "į"); diff --git a/select2_locale_lv.js b/select2_locale_lv.js index b300ec77..4afc5b41 100644 --- a/select2_locale_lv.js +++ b/select2_locale_lv.js @@ -6,12 +6,14 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['lv'] = { formatNoMatches: function () { return "Sakritību nav"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "Lūdzu ievadiet vēl " + n + " simbol" + (n == 11 ? "us" : n%10 == 1 ? "u" : "us"); }, formatInputTooLong: function (input, max) { var n = input.length - max; return "Lūdzu ievadiet par " + n + " simbol" + (n == 11 ? "iem" : n%10 == 1 ? "u" : "iem") + " mazāk"; }, formatSelectionTooBig: function (limit) { return "Jūs varat izvēlēties ne vairāk kā " + limit + " element" + (limit == 11 ? "us" : limit%10 == 1 ? "u" : "us"); }, formatLoadMore: function (pageNumber) { return "Datu ielāde…"; }, formatSearching: function () { return "Meklēšana…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['lv']); })(jQuery); diff --git a/select2_locale_mk.js b/select2_locale_mk.js index 513562c5..8a51a9e0 100644 --- a/select2_locale_mk.js +++ b/select2_locale_mk.js @@ -6,12 +6,14 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['mk'] = { formatNoMatches: function () { return "Нема пронајдено совпаѓања"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "Ве молиме внесете уште " + n + " карактер" + (n == 1 ? "" : "и"); }, formatInputTooLong: function (input, max) { var n = input.length - max; return "Ве молиме внесете " + n + " помалку карактер" + (n == 1? "" : "и"); }, formatSelectionTooBig: function (limit) { return "Можете да изберете само " + limit + " ставк" + (limit == 1 ? "а" : "и"); }, formatLoadMore: function (pageNumber) { return "Вчитување резултати…"; }, formatSearching: function () { return "Пребарување…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['mk']); })(jQuery); \ No newline at end of file diff --git a/select2_locale_ms.js b/select2_locale_ms.js index 262042aa..46588d6d 100644 --- a/select2_locale_ms.js +++ b/select2_locale_ms.js @@ -6,12 +6,14 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['ms'] = { formatNoMatches: function () { return "Tiada padanan yang ditemui"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "Sila masukkan " + n + " aksara lagi"; }, formatInputTooLong: function (input, max) { var n = input.length - max; return "Sila hapuskan " + n + " aksara"; }, formatSelectionTooBig: function (limit) { return "Anda hanya boleh memilih " + limit + " pilihan"; }, formatLoadMore: function (pageNumber) { return "Sedang memuatkan keputusan…"; }, formatSearching: function () { return "Mencari…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['ms']); })(jQuery); diff --git a/select2_locale_nl.js b/select2_locale_nl.js index 5b5c4156..4e283af4 100644 --- a/select2_locale_nl.js +++ b/select2_locale_nl.js @@ -4,12 +4,14 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['nl'] = { formatNoMatches: function () { return "Geen resultaten gevonden"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "Vul " + n + " karakter" + (n == 1? "" : "s") + " meer in"; }, formatInputTooLong: function (input, max) { var n = input.length - max; return "Vul " + n + " karakter" + (n == 1? "" : "s") + " minder in"; }, formatSelectionTooBig: function (limit) { return "Maximaal " + limit + " item" + (limit == 1 ? "" : "s") + " toegestaan"; }, formatLoadMore: function (pageNumber) { return "Meer resultaten laden…"; }, formatSearching: function () { return "Zoeken…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['nl']); })(jQuery); \ No newline at end of file diff --git a/select2_locale_no.js b/select2_locale_no.js index ab61c082..e00408cf 100644 --- a/select2_locale_no.js +++ b/select2_locale_no.js @@ -6,13 +6,15 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['no'] = { formatNoMatches: function () { return "Ingen treff"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "Vennligst skriv inn " + n + (n>1 ? " flere tegn" : " tegn til"); }, formatInputTooLong: function (input, max) { var n = input.length - max; return "Vennligst fjern " + n + " tegn"; }, formatSelectionTooBig: function (limit) { return "Du kan velge maks " + limit + " elementer"; }, formatLoadMore: function (pageNumber) { return "Laster flere resultater…"; }, formatSearching: function () { return "Søker…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['no']); })(jQuery); diff --git a/select2_locale_pl.js b/select2_locale_pl.js index 61cad44a..d77648ff 100644 --- a/select2_locale_pl.js +++ b/select2_locale_pl.js @@ -8,14 +8,16 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['pl'] = { formatNoMatches: function () { return "Brak wyników"; }, formatInputTooShort: function (input, min) { return "Wpisz co najmniej" + character(min - input.length, "znak", "i"); }, formatInputTooLong: function (input, max) { return "Wpisana fraza jest za długa o" + character(input.length - max, "znak", "i"); }, formatSelectionTooBig: function (limit) { return "Możesz zaznaczyć najwyżej" + character(limit, "element", "y"); }, formatLoadMore: function (pageNumber) { return "Ładowanie wyników…"; }, formatSearching: function () { return "Szukanie…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['pl']); function character (n, word, pluralSuffix) { return " " + n + " " + word + (n == 1 ? "" : n%10 < 5 && n%10 > 1 && (n%100 < 5 || n%100 > 20) ? pluralSuffix : "ów"); diff --git a/select2_locale_pt-BR.js b/select2_locale_pt-BR.js index ac4969ac..e4088f0c 100644 --- a/select2_locale_pt-BR.js +++ b/select2_locale_pt-BR.js @@ -4,12 +4,14 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['pt-BR'] = { formatNoMatches: function () { return "Nenhum resultado encontrado"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "Digite mais " + n + " caracter" + (n == 1? "" : "es"); }, formatInputTooLong: function (input, max) { var n = input.length - max; return "Apague " + n + " caracter" + (n == 1? "" : "es"); }, formatSelectionTooBig: function (limit) { return "Só é possível selecionar " + limit + " elemento" + (limit == 1 ? "" : "s"); }, formatLoadMore: function (pageNumber) { return "Carregando mais resultados…"; }, formatSearching: function () { return "Buscando…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['pt-BR']); })(jQuery); diff --git a/select2_locale_pt-PT.js b/select2_locale_pt-PT.js index cced7cf3..ae55a4fc 100644 --- a/select2_locale_pt-PT.js +++ b/select2_locale_pt-PT.js @@ -4,12 +4,14 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['pt-PT'] = { formatNoMatches: function () { return "Nenhum resultado encontrado"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "Introduza " + n + " car" + (n == 1 ? "ácter" : "acteres"); }, formatInputTooLong: function (input, max) { var n = input.length - max; return "Apague " + n + " car" + (n == 1 ? "ácter" : "acteres"); }, formatSelectionTooBig: function (limit) { return "Só é possível selecionar " + limit + " elemento" + (limit == 1 ? "" : "s"); }, formatLoadMore: function (pageNumber) { return "A carregar mais resultados…"; }, formatSearching: function () { return "A pesquisar…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['pt-PT']); })(jQuery); diff --git a/select2_locale_ro.js b/select2_locale_ro.js index 87eca4cf..21b0cf18 100644 --- a/select2_locale_ro.js +++ b/select2_locale_ro.js @@ -4,12 +4,14 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['ro'] = { formatNoMatches: function () { return "Nu a fost găsit nimic"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "Vă rugăm să introduceți incă " + n + " caracter" + (n == 1 ? "" : "e"); }, formatInputTooLong: function (input, max) { var n = input.length - max; return "Vă rugăm să introduceți mai puțin de " + n + " caracter" + (n == 1? "" : "e"); }, formatSelectionTooBig: function (limit) { return "Aveți voie să selectați cel mult " + limit + " element" + (limit == 1 ? "" : "e"); }, formatLoadMore: function (pageNumber) { return "Se încarcă…"; }, formatSearching: function () { return "Căutare…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['ro']); })(jQuery); diff --git a/select2_locale_rs.js b/select2_locale_rs.js index 300c01bc..72c16389 100644 --- a/select2_locale_rs.js +++ b/select2_locale_rs.js @@ -6,12 +6,14 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['rs'] = { formatNoMatches: function () { return "Ništa nije pronađeno"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "Ukucajte bar još " + n + " simbol" + (n % 10 == 1 && n % 100 != 11 ? "" : "a"); }, formatInputTooLong: function (input, max) { var n = input.length - max; return "Obrišite " + n + " simbol" + (n % 10 == 1 && n % 100 != 11 ? "" : "a"); }, formatSelectionTooBig: function (limit) { return "Možete izabrati samo " + limit + " stavk" + (limit % 10 == 1 && limit % 100 != 11 ? "u" : (limit % 10 >= 2 && limit % 10 <= 4 && (limit % 100 < 12 || limit % 100 > 14)? "e" : "i")); }, formatLoadMore: function (pageNumber) { return "Preuzimanje još rezultata…"; }, formatSearching: function () { return "Pretraga…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['rs']); })(jQuery); diff --git a/select2_locale_ru.js b/select2_locale_ru.js index 5ec58e47..2a6c7702 100644 --- a/select2_locale_ru.js +++ b/select2_locale_ru.js @@ -6,14 +6,16 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['ru'] = { formatNoMatches: function () { return "Совпадений не найдено"; }, formatInputTooShort: function (input, min) { return "Пожалуйста, введите еще хотя бы" + character(min - input.length); }, formatInputTooLong: function (input, max) { return "Пожалуйста, введите на" + character(input.length - max) + " меньше"; }, formatSelectionTooBig: function (limit) { return "Вы можете выбрать не более " + limit + " элемент" + (limit%10 == 1 && limit%100 != 11 ? "а" : "ов"); }, formatLoadMore: function (pageNumber) { return "Загрузка данных…"; }, formatSearching: function () { return "Поиск…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['ru']); function character (n) { return " " + n + " символ" + (n%10 < 5 && n%10 > 0 && (n%100 < 5 || n%100 > 20) ? n%10 > 1 ? "a" : "" : "ов"); diff --git a/select2_locale_sk.js b/select2_locale_sk.js index 772f304a..10d2b503 100644 --- a/select2_locale_sk.js +++ b/select2_locale_sk.js @@ -10,8 +10,8 @@ 2: function(masc) { return (masc ? "dva" : "dve"); }, 3: function() { return "tri"; }, 4: function() { return "štyri"; } - } - $.extend($.fn.select2.defaults, { + }; + $.fn.select2.locales['sk'] = { formatNoMatches: function () { return "Nenašli sa žiadne položky"; }, formatInputTooShort: function (input, min) { var n = min - input.length; @@ -44,5 +44,7 @@ }, formatLoadMore: function (pageNumber) { return "Načítavajú sa ďalšie výsledky…"; }, formatSearching: function () { return "Vyhľadávanie…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['sk']); })(jQuery); diff --git a/select2_locale_sv.js b/select2_locale_sv.js index d611189a..96f8c0a8 100644 --- a/select2_locale_sv.js +++ b/select2_locale_sv.js @@ -6,12 +6,14 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['sv'] = { formatNoMatches: function () { return "Inga träffar"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "Var god skriv in " + n + (n>1 ? " till tecken" : " tecken till"); }, formatInputTooLong: function (input, max) { var n = input.length - max; return "Var god sudda ut " + n + " tecken"; }, formatSelectionTooBig: function (limit) { return "Du kan max välja " + limit + " element"; }, formatLoadMore: function (pageNumber) { return "Laddar fler resultat…"; }, formatSearching: function () { return "Söker…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['sv']); })(jQuery); diff --git a/select2_locale_th.js b/select2_locale_th.js index df59bdac..7f3e6ef8 100644 --- a/select2_locale_th.js +++ b/select2_locale_th.js @@ -6,12 +6,14 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['th'] = { formatNoMatches: function () { return "ไม่พบข้อมูล"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "โปรดพิมพ์เพิ่มอีก " + n + " ตัวอักษร"; }, formatInputTooLong: function (input, max) { var n = input.length - max; return "โปรดลบออก " + n + " ตัวอักษร"; }, formatSelectionTooBig: function (limit) { return "คุณสามารถเลือกได้ไม่เกิน " + limit + " รายการ"; }, formatLoadMore: function (pageNumber) { return "กำลังค้นข้อมูลเพิ่ม…"; }, formatSearching: function () { return "กำลังค้นข้อมูล…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['th']); })(jQuery); diff --git a/select2_locale_tr.js b/select2_locale_tr.js index f834dad2..1dda95ca 100644 --- a/select2_locale_tr.js +++ b/select2_locale_tr.js @@ -6,12 +6,14 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['tr'] = { formatNoMatches: function () { return "Sonuç bulunamadı"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "En az " + n + " karakter daha girmelisiniz"; }, formatInputTooLong: function (input, max) { var n = input.length - max; return n + " karakter azaltmalısınız"; }, formatSelectionTooBig: function (limit) { return "Sadece " + limit + " seçim yapabilirsiniz"; }, formatLoadMore: function (pageNumber) { return "Daha fazla…"; }, formatSearching: function () { return "Aranıyor…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['tr']); })(jQuery); diff --git a/select2_locale_uk.js b/select2_locale_uk.js index 8d31a056..b5bd0e02 100644 --- a/select2_locale_uk.js +++ b/select2_locale_uk.js @@ -7,7 +7,7 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['uk'] = { formatMatches: function (matches) { return character(matches, "результат") + " знайдено, використовуйте клавіші зі стрілками вверх та вниз для навігації."; }, formatNoMatches: function () { return "Нічого не знайдено"; }, formatInputTooShort: function (input, min) { return "Введіть буль ласка ще " + character(min - input.length, "символ"); }, @@ -15,7 +15,9 @@ formatSelectionTooBig: function (limit) { return "Ви можете вибрати лише " + character(limit, "елемент"); }, formatLoadMore: function (pageNumber) { return "Завантаження даних…"; }, formatSearching: function () { return "Пошук…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['uk']); function character (n, word) { return n + " " + word + (n%10 < 5 && n%10 > 0 && (n%100 < 5 || n%100 > 19) ? n%10 > 1 ? "и" : "" : "ів"); diff --git a/select2_locale_vi.js b/select2_locale_vi.js index 5dbc2753..cc67065f 100644 --- a/select2_locale_vi.js +++ b/select2_locale_vi.js @@ -6,13 +6,15 @@ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['vi'] = { formatNoMatches: function () { return "Không tìm thấy kết quả"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "Vui lòng nhập nhiều hơn " + n + " ký tự" + (n == 1 ? "" : "s"); }, formatInputTooLong: function (input, max) { var n = input.length - max; return "Vui lòng nhập ít hơn " + n + " ký tự" + (n == 1? "" : "s"); }, formatSelectionTooBig: function (limit) { return "Chỉ có thể chọn được " + limit + " tùy chọn" + (limit == 1 ? "" : "s"); }, formatLoadMore: function (pageNumber) { return "Đang lấy thêm kết quả…"; }, formatSearching: function () { return "Đang tìm…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['vi']); })(jQuery); diff --git a/select2_locale_zh-CN.js b/select2_locale_zh-CN.js index 6add3c52..e988dac1 100644 --- a/select2_locale_zh-CN.js +++ b/select2_locale_zh-CN.js @@ -3,12 +3,14 @@ */ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['zh-CN'] = { formatNoMatches: function () { return "没有找到匹配项"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "请再输入" + n + "个字符";}, formatInputTooLong: function (input, max) { var n = input.length - max; return "请删掉" + n + "个字符";}, formatSelectionTooBig: function (limit) { return "你只能选择最多" + limit + "项"; }, formatLoadMore: function (pageNumber) { return "加载结果中…"; }, formatSearching: function () { return "搜索中…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['zh-CN']); })(jQuery); diff --git a/select2_locale_zh-TW.js b/select2_locale_zh-TW.js index f072381f..85dbd5af 100644 --- a/select2_locale_zh-TW.js +++ b/select2_locale_zh-TW.js @@ -3,12 +3,14 @@ */ (function ($) { "use strict"; - $.extend($.fn.select2.defaults, { + $.fn.select2.locales['zh-TW'] = { formatNoMatches: function () { return "沒有找到相符的項目"; }, formatInputTooShort: function (input, min) { var n = min - input.length; return "請再輸入" + n + "個字元";}, formatInputTooLong: function (input, max) { var n = input.length - max; return "請刪掉" + n + "個字元";}, formatSelectionTooBig: function (limit) { return "你只能選擇最多" + limit + "項"; }, formatLoadMore: function (pageNumber) { return "載入中…"; }, formatSearching: function () { return "搜尋中…"; } - }); + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['zh-TW']); })(jQuery);