From 813fb3d1436ef11ec90c8367226de351a4e9a0d7 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 11 Aug 2026 07:47:23 -0400 Subject: [PATCH] Bug 43260: (follow-up) Move debug menu JS into js_includes.inc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The _() function isn't available to JS in intranet-bottom.inc. To test, apply the patch and test that the correct strings are translatable. In this example I'm testing fr-FR: - Update a translation: > gulp po:update > cd misc/translator > perl translate update fr-FR - Open the corresponding .po file for the strings pulled from the template e.g. misc/translator/po/fr-FR-staff-prog.po - Locate strings pulled from includes/js_includes.inc for translation, e.g.: #: koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc:105 #, fuzzy msgid "Disable custom CSS" msgstr "Désactiver " - Remove the "fuzzy" line. - Edit the "msgstr" string however you want (it's just for testing) - Install the updated translation: > perl translate install fr-FR Log in to the staff interface as a user with debug permission. Test the debug menu in the header, confirming that the strings look correct and that the toggles work correctly. Switch to your translated templates and test again. Sponsored-by: Athens County Public Libraries Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Pedro Amorim --- .../prog/en/includes/intranet-bottom.inc | 102 ------------------ .../prog/en/includes/js_includes.inc | 102 ++++++++++++++++++ 2 files changed, 102 insertions(+), 102 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc index bd7d9354c6..04766d3133 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc @@ -186,108 +186,6 @@ [% END %] [% END %] -[% IF Koha.debug_flag %] - -[% END # IF %] - [% IF ( footerjs ) %] [% INCLUDE js_includes.inc %] [% jsinclude | $raw # Parse the page template's JavaScript block if necessary %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc index 1d36e7e8aa..7a2f5d8341 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc @@ -100,4 +100,106 @@ [% IF Koha.Preference( 'CookieConsent' ) %] [% Asset.js("js/cookieconsent.js") | $raw %] [% END %] + +[% IF Koha.debug_flag %] + +[% END # IF %]