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>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Owen Leonard 2023-03-24 12:52:28 +00:00 committed by Tomas Cohen Arazi
parent ad53b3b538
commit 95aaf42696
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -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 ]
[% # 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 ]
[% # [ 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 ]
[% # [ 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 ]
[% # [ ELSE ] %]
[% # [ WRAPPER breadcrumb_item bc_active = 1 ] %]
[% # Module page %]
[% # [ END ] %]
[% # [ END #/IF op = add_form ] %]
[ END #/ WRAPPER breadcrumbs ]
%]
[% # [ END #/ WRAPPER breadcrumbs ] %]
[%# Used to build breadcrumb navigation nav %]
[% # Used to build breadcrumb navigation nav %]
[% BLOCK breadcrumbs %]
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
<ol>