Bug 29589 - Translation issue with formatting in MARC overlay rules page
Summary: Translation issue with formatting in MARC overlay rules page
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 14957
Blocks:
  Show dependency treegraph
 
Reported: 2021-11-29 08:04 UTC by Katrin Fischer
Modified: 2022-12-12 21:23 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:
22.05.00,21.11.04


Attachments
Bug 29589: MARCOverlayRules - fix translatability issue (1.87 KB, patch)
2021-11-30 13:11 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 29589: MARCOverlayRules - fix translatability issue (1.92 KB, patch)
2021-12-01 06:02 UTC, David Nind
Details | Diff | Splinter Review
Bug 29589: MARCOverlayRules - fix translatability issue (1.98 KB, patch)
2021-12-18 21:43 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 29589: MARCOverlayRules - fix translatability issue (1.98 KB, patch)
2022-02-26 22:51 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 29589: (follow-up) Add TT filter (1.33 KB, patch)
2022-02-26 22:51 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 Katrin Fischer 2021-11-29 08:04:06 UTC
The message in the new MARC overlay rules page has bold formatting on the system preference names which breaks the string and leaves you with a single "the" to translate. But for languages like German "the" translates to different words depending on the 'gender' of the word. So we need to make sure that the word and the article appear together for translation:

The MARCOverlayRules preference is not set, don't forget to enable it for rules to take effect.
Comment 1 Jonathan Druart 2021-11-30 13:11:23 UTC
Created attachment 128103 [details] [review]
Bug 29589: MARCOverlayRules - fix translatability issue

Strings must not contain html tags, we should use KohaSpan instead.

Test plan:
Apply the patch, update translation for a given language, edit XX-YY-staff-prog.po

Notice that the string is now
"The %s preference is not set, don't forget to enable it for rules to take effect."
Comment 2 David Nind 2021-12-01 06:02:08 UTC
Created attachment 128116 [details] [review]
Bug 29589: MARCOverlayRules - fix translatability issue

Strings must not contain html tags, we should use KohaSpan instead.

Test plan:
Apply the patch, update translation for a given language, edit XX-YY-staff-prog.po

Notice that the string is now
"The %s preference is not set, don't forget to enable it for rules to take effect."

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Katrin Fischer 2021-12-18 21:43:18 UTC
Created attachment 128698 [details] [review]
Bug 29589: MARCOverlayRules - fix translatability issue

Strings must not contain html tags, we should use KohaSpan instead.

Test plan:
Apply the patch, update translation for a given language, edit XX-YY-staff-prog.po

Notice that the string is now
"The %s preference is not set, don't forget to enable it for rules to take effect."

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Katrin Fischer 2021-12-18 21:44:19 UTC
Thanks for the fix! I didn't know about KohaSpan. I wonder if we could move this issue into coding guidelines somehow with some example on how to make formatting work without making it hard for translators.
Comment 5 Jonathan Druart 2021-12-20 08:47:15 UTC
Agreed, it should be part of the guidelines. Maybe we should wait for bug 29602, it contains several examples of what must be done (if we agree there).
Comment 6 Fridolin Somers 2022-01-11 22:45:14 UTC
QA tools returns :
 FAIL	koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt
   FAIL	  filters
		missing_filter at line 59 (                    The [%  pref_MARCOverlayRules_link | $KohaSpan %] preference is not set, don't forget to enable it for rules to take effect.)

I'm opening a new report for the usage of KohaSpan + filters.
Comment 7 Katrin Fischer 2022-02-26 22:48:59 UTC
I am not completely sure about my follow-up, but to explain:

Adding a html filter, won't work, as the text in the span is actually HTML - a link in this case. so if you make it html | $KohaSpan it will just output the HTML and destroy the link (tested).

Maybe we'd need something more flexible than KohaSpan - KohaTag? Having parameters that allow us to specify the html tag for the surrounding elements and href in addition to class and id.

For now I am proposing $raw.
Comment 8 Katrin Fischer 2022-02-26 22:51:22 UTC
Created attachment 131151 [details] [review]
Bug 29589: MARCOverlayRules - fix translatability issue

Strings must not contain html tags, we should use KohaSpan instead.

Test plan:
Apply the patch, update translation for a given language, edit XX-YY-staff-prog.po

Notice that the string is now
"The %s preference is not set, don't forget to enable it for rules to take effect."

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 9 Katrin Fischer 2022-02-26 22:51:26 UTC
Created attachment 131152 [details] [review]
Bug 29589: (follow-up) Add TT filter
Comment 10 Jonathan Druart 2022-02-28 16:55:42 UTC
This follow-up is a no-op, we shouldn't need it.
Comment 11 Katrin Fischer 2022-02-28 18:26:31 UTC
(In reply to Jonathan Druart from comment #10)
> This follow-up is a no-op, we shouldn't need it.

It would be just to silence the QA test tools. But you are right, it's no funtional change (are raw filters ever?) :)
Comment 12 Fridolin Somers 2022-03-02 08:48:47 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄
Comment 13 Kyle M Hall 2022-03-04 14:13:25 UTC
Pushed to 21.11.x for 21.11.04
Comment 14 Andrew Fuerste-Henry 2022-04-15 17:52:07 UTC
Missing dependency, not backported to 21.05