Bugzilla – Attachment 165506 Details for
Bug 36171
Extraction of Template Toolkit directive as translatable string causes patron view error in several languages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36171: Incorrect translation of Template Toolkit directive causes patron view error in ru-RU
Bug-36171-Incorrect-translation-of-Template-Toolki.patch (text/plain), 5.02 KB, created by
Kevin Carnes
on 2024-04-25 09:30:49 UTC
(
hide
)
Description:
Bug 36171: Incorrect translation of Template Toolkit directive causes patron view error in ru-RU
Filename:
MIME Type:
Creator:
Kevin Carnes
Created:
2024-04-25 09:30:49 UTC
Size:
5.02 KB
patch
obsolete
>From 831f2a80dd037621c6dd982b69bb59cf7092d2e4 Mon Sep 17 00:00:00 2001 >From: Kevin Carnes <kevin.carnes@ub.lu.se> >Date: Thu, 25 Apr 2024 09:30:20 +0200 >Subject: [PATCH] Bug 36171: Incorrect translation of Template Toolkit > directive causes patron view error in ru-RU > >It appears that the template parser parses HTML tags first and then template >toolkit tags. This can cause a template toolkit tag that contains an HTML tag >to have its start and end markers separated. This causes it to be treated as >text that can be translated instead of a template toolkit tag. > >The template toolkit tags should probably be parsed first, but as a workaround >the HTML tags in a template toolkit tag can be obfuscated. This patch uses >concatenation as an example. > >To test: >1. You will need to edit the staff-prog.po for a language and modify the > the translation for "SET line_break". You can change SET to FOO. >2. Install the translation for the language. >3. View the details of a patron in the staff interface with the language. >4. The page will have an error. >5. Apply the patch. >6. Install the translation for the language. >7. View the details of a patron in the staff interface with the language. >8. The page should now display correctly. > >If you want to, you can run "gulp po:update --lang LANGUAGE-CODE" to make sure >that the template tag is no longer included in .po file. >--- > .../prog/en/includes/member-display-address-style.inc | 2 +- > .../intranet-tmpl/prog/en/modules/admin/curbside_pickup.tt | 2 +- > .../intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt | 2 +- > .../opac-tmpl/bootstrap/en/includes/display-library-address.inc | 2 +- > 4 files changed, 4 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style.inc >index 83fa575bd1..1f23dbfb75 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style.inc >@@ -1,7 +1,7 @@ > [%~ USE Koha ~%] > [%~ USE raw ~%] > [%~ BLOCK 'display-address-style' ~%] >- [%~ SET line_break = "<br/>" ~%] >+ [%~ SET line_break = "<" _ "br/>" ~%] > [%~ IF no_line_break %][% SET line_break = " " %][% END ~%] > [%~ IF Koha.Preference( 'AddressFormat' ) ~%] > [%~ PROCESS "member-display-address-style-${ Koha.Preference( 'AddressFormat' ) }" ~%] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/curbside_pickup.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/curbside_pickup.tt >index 7a2a532a7b..141003bd8a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/curbside_pickup.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/curbside_pickup.tt >@@ -60,7 +60,7 @@ > <h1>Curbside pickup configuration</h1> > > [% UNLESS Koha.Preference('CurbsidePickup') %] >- [% SET pref_CurbsidePickup_link = '<a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=CurbsidePickup">CurbsidePickup</a>' %] >+ [% SET pref_CurbsidePickup_link = '<' _ 'a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=CurbsidePickup">CurbsidePickup<' _ '/a>' %] > <div class="dialog message">The [% pref_CurbsidePickup_link | $raw | $KohaSpan %] preference is not enabled, do not forget to enable it to turn the feature on.</div> > [% END %] > <form method="post" class="form"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt >index 58a70e242b..1743321077 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt >@@ -61,7 +61,7 @@ > [% END %] > > [% UNLESS Koha.Preference( 'MARCOverlayRules' ) %] >- [% SET pref_MARCOverlayRules_link = '<a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=MARCOverlayRules">MARCOverlayRules</a>' %] >+ [% SET pref_MARCOverlayRules_link = '<' _ 'a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=MARCOverlayRules">MARCOverlayRules<' _ '/a>' %] > <div class="dialog message"> > The [% pref_MARCOverlayRules_link | $raw | $KohaSpan %] preference is not set, don't forget to enable it for rules to take effect. > </div> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/display-library-address.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/display-library-address.inc >index 5d129115c1..7f26800b8e 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/display-library-address.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/display-library-address.inc >@@ -1,7 +1,7 @@ > [%~ USE Koha ~%] > [%~ USE raw ~%] > [%~ BLOCK 'display-library-address' ~%] >- [%~ SET line_break = "<br/>" ~%] >+ [%~ SET line_break = "<" _ "br/>" ~%] > [%~ IF no_line_break %][% SET line_break = " " %][% END ~%] > [%~ IF Koha.Preference( 'AddressFormat' ) == "us" ~%] > [%~ PROCESS 'display-library-address-us' ~%] >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36171
:
162490
|
162516
|
165506
|
170194
|
170195
|
170227
|
170262
|
170342
|
172327
|
172334
|
173252