From de8d0a75996dcb5a6df38a11e6b4716a26e693a5 Mon Sep 17 00:00:00 2001 From: Martin Renvoize <martin.renvoize@ptfs-europe.com> 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 a631f3c594..fc8e7bf8d3 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 = $('<div id="toolbar" class="btn-toolbar"></div>'); - bundle_toolbar.append('<a class="btn btn-default" data-toggle="modal" data-target="#addToBundleModal" data-item="' + itemnumber + '"><i class="fa fa-plus"></i> Add to bundle</a>'); - bundle_toolbar.append('<a class="btn btn-default" data-toggle="modal" data-target="#removeFromBundleModal" data-item="' + itemnumber + '"><i class="fa fa-minus"></i> Remove from bundle</a>'); + bundle_toolbar.append('<a class="btn btn-default" data-toggle="modal" data-target="#addToBundleModal" data-item="' + itemnumber + '"><i class="fa fa-plus"></i> ' + _("Add to bundle") + '</a>'); + bundle_toolbar.append('<a class="btn btn-default" data-toggle="modal" data-target="#removeFromBundleModal" data-item="' + itemnumber + '"><i class="fa fa-minus"></i> ' + _("Remove from bundle") + '</a>'); // This is the table we'll convert into a DataTable var bundles_table = $('<table class="display tbundle" data-itemnumber="'+itemnumber+'" id="bundle_table_'+itemnumber+'" width="100%"/>'); @@ -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 = '<button class="btn btn-default btn-xs remove" role="button" data-itemnumber="'+row.item_id+'"><i class="fa fa-minus" aria-hidden="true"></i> '+_("Remove")+'</button>\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('<div id="addResult" class="alert alert-success">Success: Added '+barcode+'</div>'); + $('#addResult').replaceWith('<div id="addResult" class="alert alert-success">'+_("Success: Added '%s'").format(barcode)+'</div>'); $('#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('<div id="addResult" class="alert alert-warning">Warning: Item '+barcode+' already attached</div>'); + $('#addResult').replaceWith('<div id="addResult" class="alert alert-warning">'+_("Warning: Item '%s' aready attached").format(barcode)+'</div>'); } else { - $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">Failure: Item '+barcode+' belongs to another bundle</div>'); + $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Item '%s' belongs to another bundle").format(barcode)+'</div>'); } } else { - $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">Failure: Check the logs for details</div>'); + $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Check the logs for details")+'</div>'); } $('#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('<div id="removeResult" class="alert alert-success">'+_("Success: Removed ")+barcode+'</div>'); + $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-success">'+_("Success: Removed '%s'").format(barcode)+'</div>'); $('#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('<div id="removeResult" class="alert alert-warning">Warning: Item '+barcode+' already attached</div>'); + $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-warning">'+_("Warning: Item '%s' already attached").format(barcode)+'</div>'); } else { - $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">Failure: Item '+barcode+' belongs to another bundle</div>'); + $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failure: Item '%s' belongs to another bundle").format(barcode)+'</div>'); } } else { - $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">Failure: Check the logs for details</div>'); + $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failure: Check the logs for details")+'</div>'); } $('#rm_external_id').val('').focus(); }); } else { - $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failed: Barcode matched more than one item ")+barcode+'</div>'); + $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failed: Barcode matched more than one item '%s'").format(barcode)+'</div>'); } }); itemReq.fail(function(data) { - $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failed: Item not found ")+barcode+'</div>'); + $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failed: Item not found '%s'").format(barcode)+'</div>'); $('#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 @@ <table class="table table-condensed table-bordered" id="items-bundle-contents-table"> <thead> <tr> - <th>[% t('Title') | html %]</th> - <th>[% t('Author') | html %]</th> - <th>[% t('Item type') | html %]</th> - <th>[% t('Barcode') | html %]</th> + <th>Title</th> + <th>Author</th> + <th>Item type</th> + <th>Barcode</th> [% IF !item.onloan %] - <th>[% t('Status') | html %]</th> + <th>Status</th> [% END %] </tr> </thead> @@ -478,9 +478,9 @@ <label for="verify-items-bundle-contents-barcodes">Barcodes <span id="verify-progress" class="pull-right" style="display: none"><span id="verified">0</span> of <span id="expected"></span> verified</span></label> <textarea autocomplete="off" id="verify-items-bundle-contents-barcodes" name="verify-items-bundle-contents-barcodes" class="form-control"></textarea> [% IF item.onloan %] - <div class="help-block">[% t('Scan all barcodes of items found in the items bundle. If any items are missing, they will be marked as lost') | html %]</div> + <div class="help-block">Scan all barcodes of items found in the items bundle. If any items are missing, they will be marked as lost</div> [% ELSE %] - <div class="help-block">[% 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 %]</div> + <div class="help-block">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</div> [% END %] </div> @@ -496,11 +496,11 @@ <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" /> [% END %] [% IF item.onloan %] - <button type="submit" class="btn btn-default"><i class="fa fa-check"></i> [% t('Confirm checkin and mark missing items as lost') | html %]</button> + <button type="submit" class="btn btn-default"><i class="fa fa-check"></i> Confirm checkin and mark missing items as lost</button> [% ELSE %] - <button type="submit" class="btn btn-default"><i class="fa fa-check"></i> [% t('Confirm inventory check and mark items as lost') | html %]</button> + <button type="submit" class="btn btn-default"><i class="fa fa-check"></i> Confirm inventory check and mark items as lost</button> [% END %] - <button type="button" data-dismiss="modal" class="btn btn-default"><i class="fa fa-close"></i> [% t('Cancel') | html %]</button> + <button type="button" data-dismiss="modal" class="btn btn-default"><i class="fa fa-close"></i> Cancel</button> </div> </form> </div> -- 2.20.1