From 983feccf648cd3c77d05795cfc0eb2c098977835 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 7 Apr 2021 18:09:09 +0000 Subject: [PATCH] Bug 27644: (follow-up) Wrap strings in translation function MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch updates the in-template JavaScript so that some English strings which were previously untranslatable. This patch wraps them in the _() function. To test, apply the patch and test that the correct strings are translatable. In this example I'm testing fr-FR: - Update a translation: > gulp po:update > cd misc/translator > perl translate update fr-FR - Open the corresponding .po file for the strings pulled from JavaScript e.g. misc/translator/po/fr-FR-staff-prog.po - Locate strings pulled from reports/guided_reports_start.tt for translation, e.g.: #: koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt:1324 #, fuzzy, c-format msgid "Authorized value category:" msgstr "Catégorie de valeur autorisée : " - Edit the "msgstr" string if necessary, or remove the "fuzzy," before "c-format" - Install the updated translation: > perl translate install fr-FR In the staff interface, switch to the language you're testing. Confirm that your translated strings appear. In this case, test in particular: - The controls on the modal window when you preview a report's SQL from the list of saved reports. - The controls and modal dialog for inserting a runtime parameter. Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- .../modules/reports/guided_reports_start.tt | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt index ac2a96362b..d037b3483d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt @@ -1488,33 +1488,33 @@ switch ( category ){ case "insertAuthVal": modalTitle.text( _("Insert authorized value parameter") ); - $("#paramLabel").val("Authorized value") + $("#paramLabel").val( _("Authorized value") ); $("#authorised_value_category").show(); $("#authorised_value").prop("required", true ).attr("required", "required"); break; case "insertDate": modalTitle.text( _("Insert date parameter") ); - $("#paramLabel").val("Date") + $("#paramLabel").val( _("Date") ); $("#param_category").val("date"); break; case "insertItemtypes": modalTitle.text( _("Insert item types parameter") ); - $("#paramLabel").val("Item type") + $("#paramLabel").val( _("Item type") ); $("#param_category").val("itemtypes"); break; case "insertBranches": modalTitle.text( _("Insert libraries parameter") ); - $("#paramLabel").val("Library") + $("#paramLabel").val( _("Library") ); $("#param_category").val("branches"); break; case "insertCategorycode": modalTitle.text( _("Insert patron category parameter") ); - $("#paramLabel").val("Patron category") + $("#paramLabel").val( _("Patron category") ); $("#param_category").val("categorycode"); break; case "insertText": modalTitle.text( _("Insert text parameter") ); - $("#paramLabel").val("Text") + $("#paramLabel").val( _("Text") ); $("#param_category").val(""); break; } @@ -1544,7 +1544,7 @@ $("body").on('click',".fetch_chart_data",function(){ if( [% unlimited_total || 0 | $raw %] > 1000 ){ - if( confirm("Fetching full chart data for reports with many rows can cause performance issues. Are you sure you with to chart this report?") ){ + if( confirm( _("Fetching full chart data for reports with many rows can cause performance issues. Are you sure you with to chart this report?") ) ){ return true; } else { return false; @@ -2154,12 +2154,12 @@ \ \ \ -- 2.39.5