Bug 33154 - Tab WRAPPER follow-up: label text must be translatable
Summary: Tab WRAPPER follow-up: label text must be translatable
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Owen Leonard
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on: 32571
Blocks:
  Show dependency treegraph
 
Reported: 2023-03-07 12:43 UTC by Owen Leonard
Modified: 2023-12-28 20:42 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.05


Attachments
Bug 33154: Tab WRAPPER follow-up: label text must be translatable (15.54 KB, patch)
2023-03-07 13:10 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 33154: Tab WRAPPER follow-up: label text must be translatable (15.61 KB, patch)
2023-03-24 19:57 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 33154: Tab WRAPPER follow-up: label text must be translatable (15.66 KB, patch)
2023-04-08 22:07 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 33154: Tab WRAPPER follow-up: label text must be translatable (18.69 KB, patch)
2023-04-13 11:49 UTC, Owen Leonard
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-07 12:43:38 UTC
The new WRAPPER system for building tabs has the unwanted side-effect of creating a situation where text is not translatable. Because the translation process looks for text inside HTML tags, the string "Server information" will not be picked up for translation:

[% WRAPPER tab_item tabname= "about" bt_active= 1 %] Server information [% END %]

Strings must be wrapped in <span> (or some variation of "[% t('A translatable string') %]."
Comment 1 Owen Leonard 2023-03-07 13:10:15 UTC
Created attachment 147835 [details] [review]
Bug 33154: Tab WRAPPER follow-up: label text must be translatable

This patch updates templates which have already been updated to use the
new tab WRAPPER system for generating tab markup. Templates are changed
so that tab label strings are wrapped in <span> to make them
translatable.

The html_helpers include file is also updated so that the example code
in comments shows the right pattern (the breadcrumb example is similarly
corrected).

To test apply the patch and run the translation script to update the .po
files, e.g.

perl misc/translator/translate update fr-FR

Check the updated .po files for some of the lines modified in the patch:

 - koha-tmpl/intranet-tmpl/prog/en/modules/about.tt:31
 - koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt:69
 - koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt:330
 - koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt:141
 - koha-tmpl/intranet-tmpl/prog/en/modules/admin/item_circulation_alerts.tt:118
 - koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt:259
 - koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt:455
 - koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt:98
Comment 2 Caroline Cyr La Rose 2023-03-24 19:57:42 UTC
Created attachment 148695 [details] [review]
Bug 33154: Tab WRAPPER follow-up: label text must be translatable

This patch updates templates which have already been updated to use the
new tab WRAPPER system for generating tab markup. Templates are changed
so that tab label strings are wrapped in <span> to make them
translatable.

The html_helpers include file is also updated so that the example code
in comments shows the right pattern (the breadcrumb example is similarly
corrected).

To test apply the patch and run the translation script to update the .po
files, e.g.

perl misc/translator/translate update fr-FR

Check the updated .po files for some of the lines modified in the patch:

 - koha-tmpl/intranet-tmpl/prog/en/modules/about.tt:31
 - koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt:69
 - koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt:330
 - koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt:141
 - koha-tmpl/intranet-tmpl/prog/en/modules/admin/item_circulation_alerts.tt:118
 - koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt:259
 - koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt:455
 - koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt:98

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 3 Katrin Fischer 2023-04-08 22:07:28 UTC
Created attachment 149326 [details] [review]
Bug 33154: Tab WRAPPER follow-up: label text must be translatable

This patch updates templates which have already been updated to use the
new tab WRAPPER system for generating tab markup. Templates are changed
so that tab label strings are wrapped in <span> to make them
translatable.

The html_helpers include file is also updated so that the example code
in comments shows the right pattern (the breadcrumb example is similarly
corrected).

To test apply the patch and run the translation script to update the .po
files, e.g.

perl misc/translator/translate update fr-FR

Check the updated .po files for some of the lines modified in the patch:

 - koha-tmpl/intranet-tmpl/prog/en/modules/about.tt:31
 - koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt:69
 - koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt:330
 - koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt:141
 - koha-tmpl/intranet-tmpl/prog/en/modules/admin/item_circulation_alerts.tt:118
 - koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt:259
 - koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt:455
 - koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt:98

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Katrin Fischer 2023-04-08 22:07:48 UTC
QA tools show this warning, but I think it's irrelevant here:

* Commit title does not contain 'follow-up' correctly spelt - b9bdec4b71

This might conflict with bug 33332.
Comment 5 Owen Leonard 2023-04-13 11:49:31 UTC
Created attachment 149592 [details] [review]
Bug 33154: Tab WRAPPER follow-up: label text must be translatable

This patch updates templates which have already been updated to use the
new tab WRAPPER system for generating tab markup. Templates are changed
so that tab label strings are wrapped in <span> to make them
translatable.

The html_helpers include file is also updated so that the example code
in comments shows the right pattern (the breadcrumb example is similarly
corrected).

To test apply the patch and run the translation script to update the .po
files, e.g.

perl misc/translator/translate update fr-FR

Check the updated .po files for some of the lines modified in the patch:

 - koha-tmpl/intranet-tmpl/prog/en/modules/about.tt:31
 - koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt:69
 - koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt:330
 - koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt:141
 - koha-tmpl/intranet-tmpl/prog/en/modules/admin/item_circulation_alerts.tt:118
 - koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt:259
 - koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt:455
 - koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt:98

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Tomás Cohen Arazi 2023-04-13 14:49:23 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 7 Matt Blenkinsop 2023-04-17 09:16:27 UTC
Nice work everyone!

Pushed to stable for 22.11.x
Comment 8 Lucas Gass 2023-05-05 22:08:55 UTC
Missing 22.05.x dependencies, no backport.