From d1f62d2f2ec4b545f93a9b524c50366dfb457f32 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 20 Jun 2022 11:14:53 +0100 Subject: [PATCH] Bug 28854: (follow-up) Translations fixes This patch wraps and unwraps strings appropriately for trasnlation. --- .../prog/en/modules/catalogue/detail.tt | 40 +++++++++---------- .../prog/en/modules/circ/returns.tt | 20 +++++----- 2 files changed, 30 insertions(+), 30 deletions(-) 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 18f4b41d59..593776677f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -1448,8 +1448,8 @@ Note that permanent location is a code, and location may be an authval. // Toolbar var bundle_toolbar = $('
'); - bundle_toolbar.append(' Add to bundle'); - bundle_toolbar.append(' Remove from bundle'); + bundle_toolbar.append(' ' + _("Add to bundle") + ''); + bundle_toolbar.append(' ' + _("Remove from bundle") + ''); // This is the table we'll convert into a DataTable var bundles_table = $(''); @@ -1481,7 +1481,7 @@ Note that permanent location is a code, and location may be an authval. "columns": [ { "data": "biblio.title:biblio.medium", - "title": "Title", + "title": _("Title"), "searchable": true, "orderable": true, "render": function(data, type, row, meta) { @@ -1500,37 +1500,37 @@ Note that permanent location is a code, and location may be an authval. }, { "data": "biblio.author", - "title": "Author", + "title": _("Author"), "searchable": true, "orderable": true, }, { "data": "collection_code", - "title": "Collection code", + "title": _("Collection"), "searchable": true, "orderable": true, }, { "data": "item_type", - "title": "Item Type", + "title": _("Item type"), "searchable": false, "orderable": true, }, { "data": "callnumber", - "title": "Callnumber", + "title": _("Callnumber"), "searchable": true, "orderable": true, }, { "data": "external_id", - "title": "Barcode", + "title": _("Barcode"), "searchable": true, "orderable": true, }, { "data": "lost_status:last_seen_date:return_claim.patron", - "title": "Status", + "title": _("Status"), "searchable": false, "orderable": true, "render": function(data, type, row, meta) { @@ -1552,7 +1552,7 @@ Note that permanent location is a code, and location may be an authval. var result = '\n'; return result; }, - "title": "Actions", + "title": _("Actions"), "searchable": false, "orderable": false, "class": "noExport" @@ -1608,7 +1608,7 @@ Note that permanent location is a code, and location may be an authval. /* Report the results */ posting.done(function(data) { var barcode = $('#external_id').val(); - $('#addResult').replaceWith('
Success: Added '+barcode+'
'); + $('#addResult').replaceWith('
'+_("Success: Added '%s'").format(barcode)+'
'); $('#external_id').val('').focus(); bundle_changed = 1; }); @@ -1617,12 +1617,12 @@ Note that permanent location is a code, and location may be an authval. if ( data.status === 409 ) { var response = data.responseJSON; if ( response.key === "PRIMARY" ) { - $('#addResult').replaceWith('
Warning: Item '+barcode+' already attached
'); + $('#addResult').replaceWith('
'+_("Warning: Item '%s' aready attached").format(barcode)+'
'); } else { - $('#addResult').replaceWith('
Failure: Item '+barcode+' belongs to another bundle
'); + $('#addResult').replaceWith('
'+_("Failure: Item '%s' belongs to another bundle").format(barcode)+'
'); } } else { - $('#addResult').replaceWith('
Failure: Check the logs for details
'); + $('#addResult').replaceWith('
'+_("Failure: Check the logs for details")+'
'); } $('#external_id').val('').focus(); }); @@ -1675,7 +1675,7 @@ Note that permanent location is a code, and location may be an authval. /* Report the results */ deleteReq.done(function(data) { var barcode = $('#rm_external_id').val(); - $('#removeResult').replaceWith('
'+_("Success: Removed ")+barcode+'
'); + $('#removeResult').replaceWith('
'+_("Success: Removed '%s'").format(barcode)+'
'); $('#rm_external_id').val('').focus(); bundle_changed = 1; }); @@ -1684,21 +1684,21 @@ Note that permanent location is a code, and location may be an authval. if ( data.status === 409 ) { var response = data.responseJSON; if ( response.key === "PRIMARY" ) { - $('#removeResult').replaceWith('
Warning: Item '+barcode+' already attached
'); + $('#removeResult').replaceWith('
'+_("Warning: Item '%s' already attached").format(barcode)+'
'); } else { - $('#removeResult').replaceWith('
Failure: Item '+barcode+' belongs to another bundle
'); + $('#removeResult').replaceWith('
'+_("Failure: Item '%s' belongs to another bundle").format(barcode)+'
'); } } else { - $('#removeResult').replaceWith('
Failure: Check the logs for details
'); + $('#removeResult').replaceWith('
'+_("Failure: Check the logs for details")+'
'); } $('#rm_external_id').val('').focus(); }); } else { - $('#removeResult').replaceWith('
'+_("Failed: Barcode matched more than one item ")+barcode+'
'); + $('#removeResult').replaceWith('
'+_("Failed: Barcode matched more than one item '%s'").format(barcode)+'
'); } }); itemReq.fail(function(data) { - $('#removeResult').replaceWith('
'+_("Failed: Item not found ")+barcode+'
'); + $('#removeResult').replaceWith('
'+_("Failed: Item not found '%s'").format(barcode)+'
'); $('#rm_external_id').val('').focus(); }); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt index e35370f3f6..421ac682df 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -436,12 +436,12 @@
- - - - + + + + [% IF !item.onloan %] - + [% END %] @@ -478,9 +478,9 @@ [% IF item.onloan %] -
[% t('Scan all barcodes of items found in the items bundle. If any items are missing, they will be marked as lost') | html %]
+
Scan all barcodes of items found in the items bundle. If any items are missing, they will be marked as lost
[% ELSE %] -
[% t('Optionally scan all barcodes of items found in the items bundle to perform an inventory check. If any items are missing, they will be marked as lost') | html %]
+
Optionally scan all barcodes of items found in the items bundle to perform an inventory check. If any items are missing, they will be marked as lost
[% END %] @@ -496,11 +496,11 @@ [% END %] [% IF item.onloan %] - + [% ELSE %] - + [% END %] - + -- 2.20.1
[% t('Title') | html %][% t('Author') | html %][% t('Item type') | html %][% t('Barcode') | html %]TitleAuthorItem typeBarcode[% t('Status') | html %]Status