You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of instantly applying the translations, add them to an array.
That way users can include the language files that their site supports
and apply the required language using $.extend($.fn.select2.defaults,
$.fn.select2.locales["nl"]);
Signed-off-by: Kevin Brown <kevin@kevinbrown.in>
formatMatches: function(matches){if(matches===1){return"One result is available, press enter to select it.";}returnmatches+" results are available, use up and down arrow keys to navigate.";},
formatSelectionTooBig: function(limit){return"You can only select "+limit+" item"+(limit==1 ? "" : "s");},
3434
-
formatLoadMore: function(pageNumber){return"Loading more results…";},
3435
-
formatSearching: function(){return"Searching…";},
3436
3428
minimumResultsForSearch: 0,
3437
3429
minimumInputLength: 0,
3438
3430
maximumInputLength: null,
@@ -3471,6 +3463,21 @@ the specific language governing permissions and limitations under the Apache Lic
3471
3463
}
3472
3464
};
3473
3465
3466
+
$.fn.select2.locales=[];
3467
+
3468
+
$.fn.select2.locales['en']={
3469
+
formatMatches: function(matches){if(matches===1){return"One result is available, press enter to select it.";}returnmatches+" results are available, use up and down arrow keys to navigate.";},
Copy file name to clipboardExpand all lines: select2_locale_ar.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
(function($){
7
7
"use strict";
8
8
9
-
$.extend($.fn.select2.defaults,{
9
+
$.fn.select2.locales['ar']={
10
10
formatNoMatches: function(){return"لم يتم العثور على مطابقات";},
11
11
formatInputTooShort: function(input,min){varn=min-input.length;if(n==1){return"الرجاء إدخال حرف واحد على الأكثر";}returnn==2 ? "الرجاء إدخال حرفين على الأكثر" : "الرجاء إدخال "+n+" على الأكثر";},
12
12
formatInputTooLong: function(input,max){varn=input.length-max;if(n==1){return"الرجاء إدخال حرف واحد على الأقل";}returnn==2 ? "الرجاء إدخال حرفين على الأقل" : "الرجاء إدخال "+n+" على الأقل ";},
Copy file name to clipboardExpand all lines: select2_locale_en.js.template
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
(function ($) {
7
7
"use strict";
8
8
9
-
$.extend($.fn.select2.defaults, {
9
+
$.fn.select2.locales['en'] = {
10
10
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."; },
11
11
formatNoMatches: function () { return "No matches found"; },
12
12
formatInputTooShort: function (input, min) { var n = min - input.length; return "Please enter " + n + " or more character" + (n == 1 ? "" : "s"); },
0 commit comments