From 5fa99d7d59ffe65a3533c79a637b50f04e904736 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 21 Aug 2020 12:11:11 +0000 Subject: [PATCH] Bug 25321: Move translatable strings out of strings.inc into the corresponding JavaScript This patch moves string definitions out of strings.inc and into the corresponding JavaScript files. To test, apply the patch and test various pages in the staff interface: A few suggestions: - Perform a catalog search and view the detail page for a bibliographic record. - Confirm that the search results browser in the left-hand sidebar work correctly and that the title attributes of the controls are correct. - Locate a patron with multiple checkouts. View the checkout page and test the various controls in the table of checkouts: Renew, check in, return claims, etc. - View the list of holds on a patron's account. Test suspending and resuming holds. 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, e.g. misc/translator/po/fr-FR-messages-js.po - Locate strings pulled from koha-tmpl/intranet-tmpl/prog/js/checkouts.js for translation, e.g.: msgid "Checked in" 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 staff client and repeat the test plan above. The translated strings should appear. Signed-off-by: Lucas Gass Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- koha-tmpl/intranet-tmpl/js/browser.js | 12 +-- .../prog/en/includes/strings.inc | 61 --------------- .../prog/en/modules/catalogue/ISBDdetail.tt | 1 - .../prog/en/modules/catalogue/MARCdetail.tt | 1 - .../prog/en/modules/catalogue/detail.tt | 1 - .../en/modules/catalogue/labeledMARCdetail.tt | 1 - .../prog/en/modules/catalogue/moredetail.tt | 1 - .../prog/en/modules/catalogue/results.tt | 1 - .../en/modules/catalogue/stockrotation.tt | 1 - .../prog/en/modules/circ/circulation.tt | 1 - .../prog/en/modules/members/moremember.tt | 1 - koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 78 +++++++++---------- koha-tmpl/intranet-tmpl/prog/js/holds.js | 50 ++++++------ .../intranet-tmpl/prog/js/pages/results.js | 2 +- 14 files changed, 72 insertions(+), 140 deletions(-) delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc diff --git a/koha-tmpl/intranet-tmpl/js/browser.js b/koha-tmpl/intranet-tmpl/js/browser.js index 66a15d1e70..ea19060a64 100644 --- a/koha-tmpl/intranet-tmpl/js/browser.js +++ b/koha-tmpl/intranet-tmpl/js/browser.js @@ -1,4 +1,4 @@ -/* global BROWSER_PREVIOUS BROWSER_NEXT BROWSER_RETURN_TO_SEARCH */ +/* global __ */ if ( KOHA === undefined ) var KOHA = {}; @@ -81,16 +81,16 @@ KOHA.browser = function (searchid, biblionumber) { var prevbutton; var nextbutton; if (me.curPos === 0 && current_search.offset === 1) { - prevbutton = ''; + prevbutton = ''; } else { - prevbutton = ''; + prevbutton = ''; } if (current_search.offset + me.curPos == current_search.total) { - nextbutton = ''; + nextbutton = ''; } else { - nextbutton = ''; + nextbutton = ''; } - $('#menu').before('
' + prevbutton + nextbutton + '
'); + $('#menu').before('
' + prevbutton + nextbutton + '
'); $('a#browse-previous').click(function (ev) { ev.preventDefault(); browseRecords(-1); diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc deleted file mode 100644 index 26aed46765..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc +++ /dev/null @@ -1,61 +0,0 @@ - - - diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt index 1e022b1b1d..b4104f9498 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt @@ -56,7 +56,6 @@ [% MACRO jsinclude BLOCK %] [% INCLUDE 'catalog-strings.inc' %] [% Asset.js("js/catalog.js") | $raw %] - [% INCLUDE 'strings.inc' %] [% Asset.js("js/browser.js") | $raw %]