From e47f2132add2b132806caeeff1631059b0f1cba8 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 20 Oct 2020 11:22:07 +0000 Subject: [PATCH] Bug 26619: Cart - The "Print" button is only translated when you are in "More details" mode This patch adds the "Print" string to datatables.js so that it can be picked up for translation. To test, apply the patch and add some items to the cart in the OPAC. - Open the cart. You should see a button labeled "Print." - The print button should work correctly. TESTING TRANSLATABILITY - Update a translation, e.g. fr-FR: > cd misc/translator > perl translate update fr-FR - Open the corresponding .po file for JavaScript strings, misc/translator/po/fr-FR-messages-js.po - Locate strings pulled from koha-tmpl/opac-tmpl/bootstrap/js/datatables.js for translation: msgid "Print" msgstr "" - Edit the "msgstr" string however you want (it's just for testing). - Install the updated translation: > perl translate install fr-FR - Switch to your newly translated language in the OPAC and repeat the test plan above. The translated strings should appear. Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart (cherry picked from commit 599a6cb92e26e37857b344484d6c8b233555f0dc) Signed-off-by: Lucas Gass --- koha-tmpl/opac-tmpl/bootstrap/js/datatables.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/datatables.js b/koha-tmpl/opac-tmpl/bootstrap/js/datatables.js index 047fa4c438..8ef91f1dfb 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/js/datatables.js +++ b/koha-tmpl/opac-tmpl/bootstrap/js/datatables.js @@ -21,7 +21,16 @@ var dataTablesDefaults = { "loadingRecords" : window.MSG_DT_LOADING_RECORDS || "Loading...", "processing" : window.MSG_DT_PROCESSING || "Processing...", "search" : window.MSG_DT_SEARCH || "Search:", - "zeroRecords" : window.MSG_DT_ZERO_RECORDS || "No matching records found" + "zeroRecords" : window.MSG_DT_ZERO_RECORDS || "No matching records found", + buttons: { + "copyTitle" : window.MSG_DT_COPY_TO_CLIPBOARD || "Copy to clipboard", + "copyKeys" : window.MSG_DT_COPY_KEYS || "Press ctrl or ⌘ + C to copy the table data
to your system clipboard.

To cancel, click this message or press escape.", + "copySuccess": { + _: window.MSG_DT_COPIED_ROWS || "Copied %d rows to clipboard", + 1: window.MSG_DT_COPIED_ONE_ROW || "Copied one row to clipboard", + }, + "print": __("Print") + } }, // "sorting": [$(" - select row position of th -")], "dom": 't', @@ -216,4 +225,4 @@ jQuery.fn.dataTable.ext.errMode = function(settings, note, message) { return $(this).dataTable(settings); }; -})(jQuery); \ No newline at end of file +})(jQuery); -- 2.39.5