Bug 33332

Summary: Fix formatting of TT comments to improve translations
Product: Koha Reporter: Owen Leonard <oleonard>
Component: I18N/L10NAssignee: Owen Leonard <oleonard>
Status: RESOLVED FIXED QA Contact: Katrin Fischer <katrin.fischer>
Severity: normal    
Priority: P5 - low CC: david, f.demians, lucas, testopia, victor
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16559
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.05
Bug Depends on: 32571    
Bug Blocks:    
Attachments: Bug 33332: Fix formatting of TT comments to improve translations
Bug 33332: Fix formatting of TT comments to improve translations
Bug 33332: Fix formatting of TT comments to improve translations

Description Owen Leonard 2023-03-24 12:23:31 UTC
The comments I added to html_helpers.inc for documenting usage of the tab and breadcrumbs wrappers are showing up in translations. 

#: koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc:357
#, c-format
msgid ""
"%s [%%# BOOTSTRAP TAB WRAPPER USAGE [ WRAPPER tabs id= \"tabs_container_id"
"\" ] [ WRAPPER tabs_nav ] [ WRAPPER tab_item tabname= \"tab_name_1\" "

The translation tool seems to have a problem with a multi-line Template::Toolkit comment. The workaround is to comment each line individually.
Comment 1 Owen Leonard 2023-03-24 13:07:07 UTC
Created attachment 148662 [details] [review]
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"
Comment 2 David Nind 2023-04-07 18:09:10 UTC
Created attachment 149285 [details] [review]
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>
Comment 3 David Nind 2023-04-07 18:10:00 UTC
I think I tested this correctly, but it may need another sign off from someone more familiar with the translation process.
Comment 4 Katrin Fischer 2023-04-08 21:17:07 UTC
Created attachment 149315 [details] [review]
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>
Comment 5 Tomás Cohen Arazi 2023-04-12 14:22:58 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 6 Matt Blenkinsop 2023-04-17 09:11:25 UTC
Nice work everyone!

Pushed to stable for 22.11.x
Comment 7 Lucas Gass 2023-05-05 21:59:05 UTC
Missing dependencies for 22.05.x, no backport.
Comment 8 Katrin Fischer 2023-06-18 10:46:21 UTC
*** Bug 30729 has been marked as a duplicate of this bug. ***