From 4d4fbbebbf09487da28b1e45b6545d5ecd995766 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 23 Mar 2023 17:42:46 +0000 Subject: [PATCH] Bug 33323: Select button in patron search modal is not translatable MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit a9d736ba74aadbc409597b58608ae33120efb368) Signed-off-by: Matt Blenkinsop (cherry picked from commit d716d4c0e19d3cd7f83cc306ef35bc178b98be4e) Signed-off-by: Lucas Gass --- koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc index 57c52a0f42..4efdb96b2c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc @@ -607,14 +607,14 @@ [% SWITCH action %] [% CASE 'select' %] let patron_str = JSON.stringify(row); - action_node += 'Select'; + action_node += '' + _("Select") + ''; let input_node = $(''); $(input_node).val(patron_str); action_node += $(input_node).prop('outerHTML'); [% CASE 'add' %] - action_node += 'Add'; + action_node += '' + _("Add") + ''; [% CASE 'edit' %] - action_node += ' Edit'; + action_node += ' ' + _("Edit") + ''; [% CASE 'checkout' %] [% IF CAN_user_circulate_circulate_remaining_permissions %] action_node += ' ' + _("Check out") + ''; -- 2.39.5