Bugzilla – Attachment 125460 Details for
Bug 29133
Wrong string format in select2.inc
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29133: Correct select2 strings
Bug-29133-Correct-select2-strings.patch (text/plain), 2.40 KB, created by
Martin Renvoize (ashimema)
on 2021-09-29 16:04:52 UTC
(
hide
)
Description:
Bug 29133: Correct select2 strings
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-09-29 16:04:52 UTC
Size:
2.40 KB
patch
obsolete
>From f87ce84d722663cef048a45aa8127aeca6423015 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 29 Sep 2021 11:05:04 +0200 >Subject: [PATCH] Bug 29133: Correct select2 strings > >We are using 'max'/'min' when the arguments are 'maximum'/'minimum'. >Also using %n, %d when only %s is working in .format() > >Have a look at https://github.com/select2/select2/blob/45f2b83ceed5231afa7b3d5b12b58ad335edd82e/src/js/select2/i18n/en.js >It's Select2 v.4.0.13, the one we are using. We should match what's >there. > >Test plan: >Bug 29002 is using minimumInputLength, you can see the difference when >selecting a patron: > "Please enter %s or more characters" >vs > "Please enter 3 or more characters" > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > koha-tmpl/intranet-tmpl/prog/js/select2.js | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/select2.js b/koha-tmpl/intranet-tmpl/prog/js/select2.js >index 0b68c3fd28..ef000ec7f0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/select2.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/select2.js >@@ -6,20 +6,20 @@ $.fn.select2.defaults.set("width", "element" ); > // Internationalization > $.fn.select2.defaults.set("language", { > errorLoading:function(){ return __("The results could not be loaded"); }, >- inputTooLong:function(e){ >- var n = e.input.length - e.max; >- return __("Please delete %d character(s)").format(n); >+ inputTooLong:function(args){ >+ var n = args.input.length - args.maximum; >+ return __("Please delete %s character(s)").format(n); > }, > inputTooShort:function(e){ >- var n = e.min - e.input.length; >- return __("Please enter %n or more characters").format(n); >+ var n = e.minimum - args.input.length; >+ return __("Please enter %s or more characters").format(n); > }, > formatResult: function(item) { > return $('<div>', {title: item.element[0].title}).text(item.text); > }, > loadingMore:function(){ return __("Loading more resultsâ¦"); }, >- maximumSelected:function(e){ >- return __("You can only select %s item(s)").format(e.max); >+ maximumSelected:function(args){ >+ return __("You can only select %s item(s)").format(args.maximum); > }, > noResults:function(){return __("No results found"); }, > searching:function(){return __("Searchingâ¦"); }, >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29133
:
125445
|
125460
|
125461
|
125646
|
125647