From 2f4737cc861468a6c4434a804faa6704130ffa19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Pi=C4=99tka?= Date: Wed, 28 Jan 2015 10:50:34 +0100 Subject: [PATCH 1/2] Added polish translation --- src/js/select2/i18n/pl.js | 43 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/js/select2/i18n/pl.js diff --git a/src/js/select2/i18n/pl.js b/src/js/select2/i18n/pl.js new file mode 100644 index 00000000..ab0945e4 --- /dev/null +++ b/src/js/select2/i18n/pl.js @@ -0,0 +1,43 @@ +define(function () { + // Polish + var charsWords = ['znak', 'znaki', 'znaków']; + var itemsWords = ['element', 'elementy', 'elementów']; + + var pluralWord = function pluralWord(numberOfChars, words) { + if (numberOfChars === 1) { + return words[0]; + } else if (numberOfChars > 1 && numberOfChars <= 4) { + return words[1]; + } else if (numberOfChars >= 5) { + return words[2]; + } + }; + + return { + errorLoading: function () { + return 'Nie można załadować wyników.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + return 'Usuń ' + overChars + ' ' + pluralWord(overChars, charsWords); + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + return 'Podaj przynajmniej ' + remainingChars + ' ' + pluralWord(remainingChars, charsWords); + }, + loadingMore: function () { + return 'Trwa ładowanie…'; + }, + maximumSelected: function (args) { + return 'Możesz zaznaczyć tylko ' + args.maximum + ' ' + pluralWord(args.maxiumum, itemsWords); + }, + noResults: function () { + return 'Brak wyników'; + }, + searching: function () { + return 'Trwa wyszukiwanie…'; + } + }; +}); \ No newline at end of file From a6b5c7df49902203d6855b03c848489cd9b8f58f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Pi=C4=99tka?= Date: Wed, 28 Jan 2015 11:06:03 +0100 Subject: [PATCH 2/2] Break long lines --- src/js/select2/i18n/pl.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/js/select2/i18n/pl.js b/src/js/select2/i18n/pl.js index ab0945e4..791776a6 100644 --- a/src/js/select2/i18n/pl.js +++ b/src/js/select2/i18n/pl.js @@ -25,13 +25,15 @@ define(function () { inputTooShort: function (args) { var remainingChars = args.minimum - args.input.length; - return 'Podaj przynajmniej ' + remainingChars + ' ' + pluralWord(remainingChars, charsWords); + return 'Podaj przynajmniej ' + remainingChars + ' ' + + pluralWord(remainingChars, charsWords); }, loadingMore: function () { return 'Trwa ładowanie…'; }, maximumSelected: function (args) { - return 'Możesz zaznaczyć tylko ' + args.maximum + ' ' + pluralWord(args.maxiumum, itemsWords); + return 'Możesz zaznaczyć tylko ' + args.maximum + ' ' + + pluralWord(args.maxiumum, itemsWords); }, noResults: function () { return 'Brak wyników';