Bug 33323 - Select button in patron search modal is not translatable
Summary: Select button in patron search modal is not translatable
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Owen Leonard
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-23 15:09 UTC by Katrin Fischer
Modified: 2023-12-28 20:44 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.05,22.05.13


Attachments
Bug 33323: Select button in patron search modal is not translatable (4.46 KB, patch)
2023-03-24 11:21 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 33323: Select button in patron search modal is not translatable (4.46 KB, patch)
2023-03-24 11:55 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 33323: Select button in patron search modal is not translatable (4.51 KB, patch)
2023-04-07 18:29 UTC, David Nind
Details | Diff | Splinter Review
Bug 33323: Select button in patron search modal is not translatable (4.56 KB, patch)
2023-04-08 21:29 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2023-03-23 15:09:23 UTC
The modal is used in different places, one example is adding an owner/user to an acquisition fund. When you search for patrons to add, the select button in the last table column is not translatable:

It's build with JS and we are missing the right mark-up.

koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc:

                                        action_node += '<a href="#" class="btn btn-default btn-xs select_user" data-borrowernumber="' + patron_id + '">Select</a><input type="hidden" id="borrower_data' + patron_id + '" name="borrower_data'+ patron_id + '" value=\''+JSON.stringify(row)+'\' />';
Comment 1 Owen Leonard 2023-03-24 11:21:05 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2023-03-24 11:55:13 UTC
Created attachment 148656 [details] [review]
Bug 33323: Select button in patron search modal is not translatable

This patch modifies the JS which generates some markup during some kinds
of patron searches so that the strings labeling submit buttons can be
translated.

To test, apply the patch and go to Administration -> Funds.
- Add a fund or edit an existing one.
- Test the "Select owner" link
  - A popup should appear, and after performing a patron search which
    returns results you should see a "Select" column in the last column
    of the patron search results table.
- Test the "Add users" link
  - Perform the same test as above. The button in the last column should
    be "Add"
- The template accommodates two other cases, "Edit" and "Check out" but
  I was unable to find a place where they were used.

- To test translatability, run the translation tool for any language,
  e.g.

  perl misc/translator/translate update fr-FR

  Search the regenerated po file (in this example
  misc/translator/po/fr-FR-staff-prog.po) to confirm that the
  correct strings are there: "Select", "Add", "Edit, and "Check out"
  should each have entries for line 234, e.g.

  koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc:234
  c-format
  msgid "Select"
  msgstr "Sélectionner"
Comment 3 David Nind 2023-04-07 18:29:40 UTC
Created attachment 149287 [details] [review]
Bug 33323: Select button in patron search modal is not translatable

This patch modifies the JS which generates some markup during some kinds
of patron searches so that the strings labeling submit buttons can be
translated.

To test, apply the patch and go to Administration -> Funds.
- Add a fund or edit an existing one.
- Test the "Select owner" link
  - A popup should appear, and after performing a patron search which
    returns results you should see a "Select" column in the last column
    of the patron search results table.
- Test the "Add users" link
  - Perform the same test as above. The button in the last column should
    be "Add"
- The template accommodates two other cases, "Edit" and "Check out" but
  I was unable to find a place where they were used.

- To test translatability, run the translation tool for any language,
  e.g.

  perl misc/translator/translate update fr-FR

  Search the regenerated po file (in this example
  misc/translator/po/fr-FR-staff-prog.po) to confirm that the
  correct strings are there: "Select", "Add", "Edit, and "Check out"
  should each have entries for line 234, e.g.

  koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc:234
  c-format
  msgid "Select"
  msgstr "Sélectionner"

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 Katrin Fischer 2023-04-08 21:29:40 UTC
Created attachment 149317 [details] [review]
Bug 33323: Select button in patron search modal is not translatable

This patch modifies the JS which generates some markup during some kinds
of patron searches so that the strings labeling submit buttons can be
translated.

To test, apply the patch and go to Administration -> Funds.
- Add a fund or edit an existing one.
- Test the "Select owner" link
  - A popup should appear, and after performing a patron search which
    returns results you should see a "Select" column in the last column
    of the patron search results table.
- Test the "Add users" link
  - Perform the same test as above. The button in the last column should
    be "Add"
- The template accommodates two other cases, "Edit" and "Check out" but
  I was unable to find a place where they were used.

- To test translatability, run the translation tool for any language,
  e.g.

  perl misc/translator/translate update fr-FR

  Search the regenerated po file (in this example
  misc/translator/po/fr-FR-staff-prog.po) to confirm that the
  correct strings are there: "Select", "Add", "Edit, and "Check out"
  should each have entries for line 234, e.g.

  koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc:234
  c-format
  msgid "Select"
  msgstr "Sélectionner"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Tomás Cohen Arazi 2023-04-12 14:44:35 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 6 Matt Blenkinsop 2023-04-17 09:11:22 UTC
Nice work everyone!

Pushed to stable for 22.11.x
Comment 7 Lucas Gass 2023-05-05 22:05:15 UTC
Backported to 22.05.x for upcoming 22.05.13.
Comment 8 Arthur Suzuki 2023-05-23 09:54:41 UTC
doesn't to apply to 21.11.
provide a backport if needed.