From 72d908b2fb3bbdc9b4769c4072680d517cbfa290 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Wed, 20 Nov 2024 10:40:54 +0000 Subject: [PATCH] Bug 38492: Update occurrences of _() to __() Test plan, ktd: 1) Generate translation files $ gulp po:update --lang de-DE 2) Verify that strings using _() do not exist on the pot file: $ cat -n misc/translator/Koha-messages-js.pot | grep "Copied!" $ cat -n misc/translator/Koha-messages-js.pot | grep "Form not submitted because of the following problem" $ cat -n misc/translator/Koha-messages-js.pot | grep "No matches found" 3) Apply patch. Repeat test plan. --- koha-tmpl/intranet-tmpl/prog/js/additem.js | 4 ++-- koha-tmpl/intranet-tmpl/prog/js/categories.js | 8 ++++---- koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 2 +- koha-tmpl/intranet-tmpl/prog/js/datatables.js | 2 +- koha-tmpl/intranet-tmpl/prog/js/pages/circulation.js | 4 ++-- koha-tmpl/intranet-tmpl/prog/js/upload-images.js | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/additem.js b/koha-tmpl/intranet-tmpl/prog/js/additem.js index 4f8c0aa7e5..5bad33ba4f 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/additem.js +++ b/koha-tmpl/intranet-tmpl/prog/js/additem.js @@ -7,11 +7,11 @@ function addItem( node, unique_item_fields ) { //We need to verify the item form before saving var empty_item_mandatory = CheckMandatorySubfields(item_form); if (empty_item_mandatory > 0) { - var _alertString= _("Form not submitted because of the following problem(s)")+"\n"; + var _alertString= __("Form not submitted because of the following problem(s)")+"\n"; _alertString +="-------------------------------------------------------------------\n\n"; _alertString += - "\n- " + _("%s item mandatory fields empty").format(empty_item_mandatory); + "\n- " + __("%s item mandatory fields empty").format(empty_item_mandatory); alert(_alertString); return false; } diff --git a/koha-tmpl/intranet-tmpl/prog/js/categories.js b/koha-tmpl/intranet-tmpl/prog/js/categories.js index 65ec948afd..e577f68508 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/categories.js +++ b/koha-tmpl/intranet-tmpl/prog/js/categories.js @@ -120,12 +120,12 @@ $(document).ready(function () { let blocked_actions_select = $("select#block_expired[multiple='multiple']"); blocked_actions_select.multipleSelect({ - placeholder: _("Please select ..."), + placeholder: __("Please select ..."), selectAll: false, hideOptgroupCheckboxes: true, - allSelected: _("All selected"), - countSelected: _("# of % selected"), - noMatchesFound: _("No matches found"), + allSelected: __("All selected"), + countSelected: __("# of % selected"), + noMatchesFound: __("No matches found"), onClick: function (view) { if ( view.value == "follow_syspref_BlockExpiredPatronOpacActions" && diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js index 20fc1ea5ff..6d0bfc179c 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js @@ -793,7 +793,7 @@ $(document).ready(function() { // Prevent form submit return false; } else { - alert(_("There are no items to be renewed.")); + alert(__("There are no items to be renewed.")); } }); diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js index 9813505421..49548623a3 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js +++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js @@ -714,7 +714,7 @@ function _dt_buttons(params){ let url = window.location.origin + window.location.pathname + '?' + searchParams.toString() + window.location.hash; if( navigator.clipboard && navigator.clipboard.writeText){ navigator.clipboard.writeText( url ); - $(node).tooltip({trigger: 'manual', title: _("Copied!")}).tooltip('show'); + $(node).tooltip({trigger: 'manual', title: __("Copied!")}).tooltip('show'); } }, } diff --git a/koha-tmpl/intranet-tmpl/prog/js/pages/circulation.js b/koha-tmpl/intranet-tmpl/prog/js/pages/circulation.js index 1fbfdf2f0a..e0686c5a35 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/pages/circulation.js +++ b/koha-tmpl/intranet-tmpl/prog/js/pages/circulation.js @@ -95,14 +95,14 @@ $(document).ready(function() { if ( $('#clubs_panel').length ) { $('#clubs-tab').on('click', function() { - $('#clubs_panel').text(_("Loading...")); + $('#clubs_panel').text(__("Loading...")); $('#clubs_panel').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=' + borrowernumber ); }); } if ( $('#pat_lists_panel').length ) { $('#pat_lists-tab').on('click', function() { - $('#pat_lists_panel').text(_("Loading...")); + $('#pat_lists_panel').text(__("Loading...")); $('#pat_lists_panel').load('/cgi-bin/koha/patron_lists/patron-lists-tab.pl?borrowernumber=' + borrowernumber ); }); } diff --git a/koha-tmpl/intranet-tmpl/prog/js/upload-images.js b/koha-tmpl/intranet-tmpl/prog/js/upload-images.js index bcaf348ab5..19eade125d 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/upload-images.js +++ b/koha-tmpl/intranet-tmpl/prog/js/upload-images.js @@ -211,12 +211,12 @@ function removeLocalImage(imagenumber) { location.href="/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=" + biblionumber; } else { thumbnail.html( copy ); - alert(_("An error occurred on deleting this image")); + alert(__("An error occurred on deleting this image")); } }, error => { thumbnail.html( copy ); - alert(_("An error occurred on deleting this image")); + alert(__("An error occurred on deleting this image")); console.warn("Something wrong happened: %s".format(error)); } ); -- 2.39.5