From 184e240effc2b702de60e996b91b78834ef56d3c Mon Sep 17 00:00:00 2001 From: xamgore <xamgore@ya.ru> Date: Sat, 7 Mar 2015 19:52:42 +0300 Subject: [PATCH] Russian localization to select menu added. If you try to search something not existing in the list of subjects, then you will get an "No matches found" message. Some people don't know english, so i added russian localization. But it should be translated soon. --- ~dev_rating/media/js/select2.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/~dev_rating/media/js/select2.js b/~dev_rating/media/js/select2.js index 7590b8229..6e5fe0ba4 100644 --- a/~dev_rating/media/js/select2.js +++ b/~dev_rating/media/js/select2.js @@ -3509,7 +3509,18 @@ the specific language governing permissions and limitations under the Apache Lic formatSearching: function () { return "Searching…"; } }; - $.extend($.fn.select2.defaults, $.fn.select2.locales['en']); + $.fn.select2.locales['ru'] = { + 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 "Совпадений не найдено"; }, + formatAjaxError: function (jqXHR, textStatus, errorThrown) { return "Загрузка прервалась"; }, + 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 "Загрузка…"; }, + formatSearching: function () { return "Поиск…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['ru']); $.fn.select2.ajaxDefaults = { transport: $.ajax, -- GitLab