Description
Katrin Fischer
2021-11-29 08:04:06 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." 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> 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> 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. 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). 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. 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. 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> Created attachment 131152 [details] [review] Bug 29589: (follow-up) Add TT filter This follow-up is a no-op, we shouldn't need it. (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?) :) Pushed to master for 22.05, thanks to everybody involved [U+1F984] Pushed to 21.11.x for 21.11.04 Missing dependency, not backported to 21.05 |