Bug 33332 - Fix formatting of TT comments to improve translations
Summary: Fix formatting of TT comments to improve translations
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Owen Leonard
QA Contact: Katrin Fischer
URL:
Keywords:
: 30729 (view as bug list)
Depends on: 32571
Blocks:
  Show dependency treegraph
 
Reported: 2023-03-24 12:23 UTC by Owen Leonard
Modified: 2023-09-09 20:28 UTC (History)
5 users (show)

See Also:
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


Attachments
Bug 33332: Fix formatting of TT comments to improve translations (6.72 KB, patch)
2023-03-24 13:07 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 33332: Fix formatting of TT comments to improve translations (6.77 KB, patch)
2023-04-07 18:09 UTC, David Nind
Details | Diff | Splinter Review
Bug 33332: Fix formatting of TT comments to improve translations (6.82 KB, patch)
2023-04-08 21:17 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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. ***