Bug 29133 - Wrong string format in select2.inc
Summary: Wrong string format in select2.inc
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Joonas Kylmälä
URL:
Keywords:
Depends on: 25727
Blocks: 29002
  Show dependency treegraph
 
Reported: 2021-09-29 09:04 UTC by Jonathan Druart
Modified: 2022-06-06 20:25 UTC (History)
8 users (show)

See Also:
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


Attachments
Bug 29133: Correct select2 strings (2.33 KB, patch)
2021-09-29 09:11 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 29133: Correct select2 strings (2.40 KB, patch)
2021-09-29 16:04 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 29133: (follow-up) Fix for arguament mismatch (1.08 KB, patch)
2021-09-29 16:04 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 29133: Correct select2 strings (2.54 KB, patch)
2021-10-02 08:43 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 29133: (follow-up) Fix for argument mismatch (1.25 KB, patch)
2021-10-02 08:43 UTC, Joonas Kylmälä
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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.