From 5d7fad99ad20d9258afd83f3b321dc9fd195e789 Mon Sep 17 00:00:00 2001
From: Owen Leonard <oleonard@myacpl.org>
Date: Fri, 24 Mar 2023 12:52:28 +0000
Subject: [PATCH] Bug 33332: Fix formatting of TT comments to improve
 translations

This patch reformats some Template::Toolkit multi-line comments in
html_helpers.inc so that each line is commented separately. This seems
to prevent the translation tool from putting the comments into the po
file.

To test, apply the patch and confirm that pages which use the
breadcrumbs and tabs WRAPPER directives still work correctly:

- Breadcrumbs: staff client home page, about page, error page.
- Tabs: Administration -> Library transfer limits or circulation alerts.
- To test translatability, run the translation tool for any language,
  e.g.

  perl misc/translator/translate update fr-FR

Search the regenerated po file (in this example
misc/translator/po/fr-FR-staff-prog.po) to confirm that there is no
instance of something like "[%%# BOOTSTRAP BREADCRUMBS WRAPPER USAGE"

Signed-off-by: David Nind <david@davidnind.com>
---
 .../prog/en/includes/html_helpers.inc         | 92 +++++++++----------
 1 file changed, 45 insertions(+), 47 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc
index e2230dd631..ac7c6b1a69 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc
@@ -357,20 +357,19 @@
 </div>
 [% END %]
 
-[%# BOOTSTRAP TAB WRAPPER USAGE
-    [ WRAPPER tabs id= "tabs_container_id" ]
-        [ WRAPPER tabs_nav ]
-            [ WRAPPER tab_item tabname= "tab_name_1" bt_active= 1 ] Tab text 1 [ END ]
-            [ WRAPPER tab_item tabname= "tab_name_2" ] Tab text 2 [ END ]
-            ...
-        [ END ]
-        [ WRAPPER tab_panels ]
-            [ WRAPPER tab_panel tabname="tab_name_1" bt_active= 1 ] Panel contents 1 [ END ]
-            [ WRAPPER tab_panel tabname="tab_name_2" ] Panel contents 2 [ END ]
-            ...
-        [ END ]
-    [ END ]
- %]
+[% # BOOTSTRAP TAB WRAPPER USAGE                                                                   %]
+[% #     [ WRAPPER tabs id= "tabs_container_id" ]                                                  %]
+[% #         [ WRAPPER tabs_nav ]                                                                  %]
+[% #             [ WRAPPER tab_item tabname= "tab_name_1" bt_active= 1 ] Tab text 1 [ END ]        %]
+[% #             [ WRAPPER tab_item tabname= "tab_name_2" ] Tab text 2 [ END ]                     %]
+[% #             ...                                                                               %]
+[% #         [ END ]                                                                               %]
+[% #         [ WRAPPER tab_panels ]                                                                %]
+[% #             [ WRAPPER tab_panel tabname="tab_name_1" bt_active= 1 ] Panel contents 1 [ END ]  %]
+[% #             [ WRAPPER tab_panel tabname="tab_name_2" ] Panel contents 2 [ END ]               %]
+[% #             ...                                                                               %]
+[% #         [ END ]                                                                               %]
+[% #     [ END ]                                                                                   %]
 
 [% BLOCK tabs %]
     [% IF ( id ) %]
@@ -416,39 +415,38 @@
     </div>
 [% END %]
 
-[%# BOOTSTRAP BREADCRUMBS WRAPPER USAGE
-    [ WRAPPER breadcrumbs ]
-        [ Home breadcrumb automatically included ]
-        [ WRAPPER breadcrumb_item ]
-            <a href="/cgi-bin/koha/module/module-home.pl"> Module </a>
-        [ END ]
-
-        [ IF op == 'add_form' ]
-            [ WRAPPER breadcrumb_item ]
-                <a href="/cgi-bin/koha/module/page.pl"> Module page </a>
-            [ END ]
-            [ WRAPPER breadcrumb_item bc_active = 1 ]
-                Add form
-            [ END ]
-
-        [ ELSIF op == 'delete_confirm' ]
-            [ WRAPPER breadcrumb_item ]
-                <a href="/cgi-bin/koha/module/page.pl"> Module page </a>
-            [ END ]
-            [ WRAPPER breadcrumb_item bc_active = 1 ]
-                Confirm deletion
-            [ END ]
-
-        [ ELSE ]
-            [ WRAPPER breadcrumb_item bc_active = 1 ]
-                Module page
-            [ END ]
-        [ END #/IF op = add_form ]
-
-    [ END #/ WRAPPER breadcrumbs ]
- %]
-
-[%# Used to build breadcrumb navigation nav %]
+[% # BOOTSTRAP BREADCRUMBS WRAPPER USAGE                                       %]
+[% #    [ WRAPPER breadcrumbs ]                                                %]
+[% #        [ Home breadcrumb automatically included ]                         %]
+[% #        [ WRAPPER breadcrumb_item ]                                        %]
+[% #            <a href="/cgi-bin/koha/module/module-home.pl"> Module </a>     %]
+[% #        [ END ]                                                            %]
+
+[% #        [ IF op == 'add_form' ]                                            %]
+[% #            [ WRAPPER breadcrumb_item ]                                    %]
+[% #                <a href="/cgi-bin/koha/module/page.pl"> Module page </a>   %]
+[% #            [ END ]                                                        %]
+[% #            [ WRAPPER breadcrumb_item bc_active = 1 ]                      %]
+[% #                Add form                                                   %]
+[% #            [ END ]                                                        %]
+
+[% #        [ ELSIF op == 'delete_confirm' ]                                   %]
+[% #            [ WRAPPER breadcrumb_item ]                                    %]
+[% #                <a href="/cgi-bin/koha/module/page.pl"> Module page </a>   %]
+[% #            [ END ]                                                        %]
+[% #            [ WRAPPER breadcrumb_item bc_active = 1 ]                      %]
+[% #                Confirm deletion                                           %]
+[% #            [ END ]                                                        %]
+
+[% #        [ ELSE ]                                                           %]
+[% #            [ WRAPPER breadcrumb_item bc_active = 1 ]                      %]
+[% #                Module page                                                %]
+[% #            [ END ]                                                        %]
+[% #        [ END #/IF op = add_form ]                                         %]
+
+[% #    [ END #/ WRAPPER breadcrumbs ]                                         %]
+
+[% # Used to build breadcrumb navigation nav %]
 [% BLOCK breadcrumbs %]
     <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
         <ol>
-- 
2.30.2