Bug 29133

Summary: Wrong string format in select2.inc
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: TemplatesAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Joonas Kylmälä <joonas.kylmala>
Severity: normal    
Priority: P5 - low CC: bgkriegel, fridolin.somers, joonas.kylmala, katrin.fischer, kyle, martin.renvoize, tomascohen, victor
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.11.00,21.05.05,20.11.11
Bug Depends on: 25727    
Bug Blocks: 29002    
Attachments: Bug 29133: Correct select2 strings
Bug 29133: Correct select2 strings
Bug 29133: (follow-up) Fix for arguament mismatch
Bug 29133: Correct select2 strings
Bug 29133: (follow-up) Fix for argument mismatch

Description Jonathan Druart 2021-09-29 09:04:19 UTC
We are using 'max'/'min' when the arguments are 'maximum'/'minimum'.
Also using %n, %d when only %s is working in .format()
Comment 1 Jonathan Druart 2021-09-29 09:11:57 UTC Comment hidden (obsolete)
Comment 2 Martin Renvoize 2021-09-29 16:04:52 UTC
Created attachment 125460 [details] [review]
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>
Comment 3 Martin Renvoize 2021-09-29 16:04:55 UTC
Created attachment 125461 [details] [review]
Bug 29133: (follow-up) Fix for arguament mismatch

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize 2021-09-29 16:06:01 UTC
Followup was required.. but feel free to squash it.

Signing off as all cases now work as expected.
Comment 5 Joonas Kylmälä 2021-10-02 08:43:25 UTC
Created attachment 125646 [details] [review]
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>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 6 Joonas Kylmälä 2021-10-02 08:43:30 UTC
Created attachment 125647 [details] [review]
Bug 29133: (follow-up) Fix for argument mismatch

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
JK: fix typo in commit message
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 7 Jonathan Druart 2021-10-06 08:38:44 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 8 Kyle M Hall 2021-10-08 14:20:42 UTC
Pushed to 21.05.x for 21.05.05
Comment 9 Fridolin Somers 2021-10-21 04:14:54 UTC
Pushed to 20.11.x for 20.11.11
Comment 10 Victor Grousset/tuxayo 2021-10-26 00:59:46 UTC
Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed.