Bugzilla – Attachment 152421 Details for
Bug 34038
Fix incorrect use of __() in .tt and .inc files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34038: Fix incorrect use of __() in .tt and .inc files
Bug-34038-Fix-incorrect-use-of--in-tt-and-inc-file.patch (text/plain), 11.87 KB, created by
Owen Leonard
on 2023-06-16 14:50:42 UTC
(
hide
)
Description:
Bug 34038: Fix incorrect use of __() in .tt and .inc files
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2023-06-16 14:50:42 UTC
Size:
11.87 KB
patch
obsolete
>From 2c91fd8cb6305de4bbbfd1bfa5ce7e91b44f8b02 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 16 Jun 2023 14:29:42 +0000 >Subject: [PATCH] Bug 34038: Fix incorrect use of __() in .tt and .inc files > >This patch corrects instances of the double-underscore function being >used in .tt and .inc files where the single-underscore function should >be used instead. > >To test, apply the patch and update a translation, e.g. fr-FR: > > > cd misc/translator > > perl translate update fr-FR > >- Open the corresponding .po file for JavaScript strings, in this case > misc/translator/po/fr-FR-staff-prog.po >- Confirm that the strings are now in the .po file for translation. You > should find these lines: > >- koha-tmpl/intranet-tmpl/prog/en/includes/js-biblio-format.inc: "No > title." >- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt: > "Check in and add to bundle" > "Ignore holds and add to bundle" >- koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step1.tt: > "Please enter only a barcode, or only a biblionumber." >- koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/batch_add_items.tt: > "Please enter only barcodes, or only biblionumbers." >- koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt: > "Please specify a content for 'Default'" > >- Check fr-FR-opac-bootstrap.po for these lines: > >- koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc: > "Please enter a valid date (should match %s)." >- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt: > "No item was selected" >- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt, > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt, > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt: > "No item was selected" >--- > .../intranet-tmpl/prog/en/includes/js-biblio-format.inc | 2 +- > .../intranet-tmpl/prog/en/modules/catalogue/detail.tt | 4 ++-- > .../prog/en/modules/course_reserves/add_items-step1.tt | 2 +- > .../prog/en/modules/course_reserves/batch_add_items.tt | 2 +- > .../prog/en/modules/tools/additional-contents.tt | 2 +- > koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc | 2 +- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt | 4 ++-- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt | 2 +- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt | 6 +++--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 8 ++++---- > 10 files changed, 17 insertions(+), 17 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/js-biblio-format.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/js-biblio-format.inc >index 5f73dc683aa..498a7a44e98 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/js-biblio-format.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/js-biblio-format.inc >@@ -23,7 +23,7 @@ > if (biblio.title != null && biblio.title != '') { > title += escape_str(biblio.title); > } else { >- title += __("No title"); >+ title += _("No title"); > } > title += '</span>'; > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index d4ead1659f4..494eb96edd3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -1976,7 +1976,7 @@ > } else if (response.error_code === 'checked_out') { > const button = $('<button type="button">') > .addClass('btn btn-xs') >- .text(__("Check in and add to bundle")) >+ .text(_("Check in and add to bundle")) > .on('click', function () { > addToBundle(url, { external_id: barcode, force_checkin: true }); > }); >@@ -1993,7 +1993,7 @@ > } else if (response.error_code === 'reserved') { > const button = $('<button type="button">') > .addClass('btn btn-xs') >- .text(__("Ignore holds and add to bundle")) >+ .text(_("Ignore holds and add to bundle")) > .on('click', function () { > addToBundle(url, { external_id: barcode, ignore_holds: true }); > }); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step1.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step1.tt >index 751c89ac1c4..346f54d3a69 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step1.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step1.tt >@@ -78,7 +78,7 @@ > $("input[type='submit']").click(function(e){ > if ( $("#biblionumber").val().length > 0 && $("#barcode").val().length > 0 ) { > e.preventDefault(); >- alert(__("Please enter only a barcode, or only a biblionumber.")); >+ alert(_("Please enter only a barcode, or only a biblionumber.")); > } > }); > }); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/batch_add_items.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/batch_add_items.tt >index eb4e674a247..f0d175fb09b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/batch_add_items.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/batch_add_items.tt >@@ -225,7 +225,7 @@ > $("input[type='submit']").click(function(e){ > if ( $("#biblionumbers").val().length > 0 && $("#barcodes").val().length > 0 ) { > e.preventDefault(); >- alert(__("Please enter only barcodes, or only biblionumbers.")); >+ alert(_("Please enter only barcodes, or only biblionumbers.")); > } > }); > }); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt >index 94cf527b3ce..c3876f619c0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt >@@ -644,7 +644,7 @@ > [% END %] > > if ( ! content.length > 0 ) { >- alert(__("Please specify a content for 'Default'")); >+ alert(_("Please specify a content for 'Default'")); > return false; > } > } >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc >index 54776d74aa5..e35701b81a6 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc >@@ -101,7 +101,7 @@ > }, > }); > >- var MSG_PLEASE_ENTER_A_VALID_DATE = ( __("Please enter a valid date (should match %s).") ); >+ var MSG_PLEASE_ENTER_A_VALID_DATE = ( _("Please enter a valid date (should match %s).") ); > > function is_valid_date(date) { > // An empty string is considered as a valid date for convenient reasons. >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt >index 7b20dad9c37..9dc2d3c7122 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt >@@ -374,7 +374,7 @@ > $("#tag_hides").hide(); > $("#tagsel_form").show(); > } else { >- alert( __("No item was selected") ); >+ alert( _("No item was selected") ); > } > } > >@@ -389,7 +389,7 @@ > function tagAdded() { > var checkedBoxes = $("input:checkbox:checked"); > if (!$(checkedBoxes).size()) { >- alert( __("No item was selected") ); >+ alert( _("No item was selected") ); > return false; > } > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >index 2109a26fd6b..c91f9cb9b57 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >@@ -656,7 +656,7 @@ > [% END %] > > if ($(".confirmjs:checked").size() == 0) { >- alert( __("No item was selected") ); >+ alert( _("No item was selected") ); > return false; > } > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >index 861d2a7db6d..411f695441d 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >@@ -607,7 +607,7 @@ > if (checkedCount > 0) { > holdBiblioNums(checkedBiblioNums); > } else { >- alert( __("No item was selected") ); >+ alert( _("No item was selected") ); > } > } > >@@ -622,7 +622,7 @@ > function tagSelected() { > var checkedBoxes = $(".searchresults :checkbox:checked"); > if ($(checkedBoxes).size() == 0) { >- alert( __("No item was selected") ); >+ alert( _("No item was selected") ); > } else { > $("#tagsel_tag").hide(); > $(".resort").hide(); >@@ -641,7 +641,7 @@ > function tagAdded() { > var checkedBoxes = $(".searchresults :checkbox:checked"); > if ($(checkedBoxes).size() == 0) { >- alert( __("No item was selected") ); >+ alert( _("No item was selected") ); > return false; > } > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >index 1bf9ae87d42..484d4045e17 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >@@ -843,7 +843,7 @@ var MSG_CONFIRM_REMOVE_SHARE = _("Are you sure you want to remove this share?"); > function holdSelections() { > var checkedBoxes = $("input:checkbox:checked"); > if ($(checkedBoxes).size() == 0) { >- alert( __("No item was selected") ); >+ alert( _("No item was selected") ); > } else { > var bibs = ""; > $(checkedBoxes).each(function(){ >@@ -861,7 +861,7 @@ var MSG_CONFIRM_REMOVE_SHARE = _("Are you sure you want to remove this share?"); > $(".tag_hides").hide(); > $("#tagsel_form").show(); > } else { >- alert( __("No item was selected") ); >+ alert( _("No item was selected") ); > } > } > >@@ -876,7 +876,7 @@ var MSG_CONFIRM_REMOVE_SHARE = _("Are you sure you want to remove this share?"); > function tagAdded() { > var checkedBoxes = $("input:checkbox:checked"); > if (!$(checkedBoxes).size()) { >- alert( __("No item was selected") ); >+ alert( _("No item was selected") ); > return false; > } > >@@ -998,7 +998,7 @@ $(function() { > return confirmDelete(MSG_REMOVE_ONE_FROM_LIST); > } > } else { >- alert( __("No item was selected") ); >+ alert( _("No item was selected") ); > return false; > } > }); >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34038
:
152421
|
155246
|
155408