Bugzilla – Attachment 136429 Details for
Bug 30991
[% ELSE %]0[% END %] will break translations if used for assigning variables
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30991: Fix remaining instances of [% ELSE %]0[% END %] in templates
Bug-30991-Fix-remaining-instances-of--ELSE-0-END--.patch (text/plain), 7.84 KB, created by
Lucas Gass (lukeg)
on 2022-06-22 20:37:35 UTC
(
hide
)
Description:
Bug 30991: Fix remaining instances of [% ELSE %]0[% END %] in templates
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2022-06-22 20:37:35 UTC
Size:
7.84 KB
patch
obsolete
>From 3dd9d5a2e567470327f9cdfeffcf2bfab1350019 Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Wed, 22 Jun 2022 08:38:58 +0000 >Subject: [PATCH] Bug 30991: Fix remaining instances of [% ELSE %]0[% END %] in > templates > >The construct of [% ELSE %]0[% END %] breaks translations as it is >translated as [% ELSE %][% END %]. Note: No 0 in the ELSE statement. > >This patchset either removes occurances of a lone 0 in template ELSE >statements, or splits it over multiple lines so the 0 is not removed in >the translated templates. > >Test plan: >1. Install the en-NZ translation >2. Search the translated templates for '[% ELSE %][% END %]' and confirm >there are are instances of that >3. Apply patch >4. Update your en-NZ translation >5. Repeat step 2 and confirm there are no more instances of [% ELSE %][% >END %] in the translated templates > >Note: I removed the [% ELSE %] statement from opac-bottom.inc as that >statement was empty in the en translation so it didn't look to be >needed. > >Sponsored-by: Catalyst IT, New Zealand > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > .../prog/en/modules/admin/smart-rules.tt | 12 ++++++++++-- > .../prog/en/modules/catalogue/moredetail.tt | 7 ++++++- > .../intranet-tmpl/prog/en/modules/tools/letter.tt | 7 ++++++- > .../opac-tmpl/bootstrap/en/includes/opac-bottom.inc | 2 +- > .../opac-tmpl/bootstrap/en/modules/opac-user.tt | 6 +++++- > 5 files changed, 28 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >index 5c6c0e6a88..deba64b069 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >@@ -202,7 +202,11 @@ > [% IF show_rule %] > [% SET row_count = row_count + 1 %] > <tr row_countd="row_[% row_count | html %]"> >- <td>[% IF ( c == undef ) %]1[% ELSE %]0[% END %]</td> >+ <td>[% IF ( c == undef ) %] >+ 1 >+ [% ELSE %] >+ 0 >+ [% END %]</td> > <td> > [% IF c == undef %] > <em>All</em> >@@ -210,7 +214,11 @@ > [% Categories.GetName(c) | html %] > [% END %] > </td> >- <td>[% IF ( i == undef ) %]1[% ELSE %]0[% END %]</td> >+ <td>[% IF ( i == undef ) %] >+ 1 >+ [% ELSE %] >+ 0 >+ [% END %]</td> > <td> > [% IF i == undef %] > <em>All</em> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >index 3e0794311a..2f7ddbd78e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >@@ -306,7 +306,12 @@ > </li> > [% END %] > >- <li><span class="label">Total checkouts:</span>[% IF ( ITEM_DAT.issues ) %][% ITEM_DAT.issues | html %][% ELSE %]0[% END %] (<a href="/cgi-bin/koha/circ/bookcount.pl?&biblionumber=[% ITEM_DAT.biblionumber | uri %]&itm=[% ITEM_DAT.itemnumber | uri %]">View item's checkout history</a>)</li> >+ <li><span class="label">Total checkouts:</span> >+ [% IF ( ITEM_DAT.issues ) %] >+ [% ITEM_DAT.issues | html %] >+ [% ELSE %] >+ 0 >+ [% END %] (<a href="/cgi-bin/koha/circ/bookcount.pl?&biblionumber=[% ITEM_DAT.biblionumber | uri %]&itm=[% ITEM_DAT.itemnumber | uri %]">View item's checkout history</a>)</li> > > <li><span class="label">Last seen:</span>[% IF ( ITEM_DAT.datelastseen ) %][% ITEM_DAT.datelastseen | $KohaDates %] [%END %] </li> > <li><span class="label">Last borrowed:</span>[% IF (ITEM_DAT.datelastborrowed ) %][% ITEM_DAT.datelastborrowed | $KohaDates %][% END %] </li> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >index 4547611965..341379e84f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >@@ -517,7 +517,12 @@ > <li> > <label for="SQLfieldname_[% letter.message_transport_type | html %]_[% lang | html %]">Message body:</label> > [% IF letter.message_transport_type == 'sms' %] >- <span class="sms_counter" id="sms_counter_[% lang | html %]">[% IF letter.content && letter.content.length > 0 %][% letter.content.length | html %][% ELSE %]0[% END %]/160 characters</span> >+ <span class="sms_counter" id="sms_counter_[% lang | html %]"> >+ [% IF letter.content && letter.content.length > 0 %] >+ [% letter.content.length | html %] >+ [% ELSE %] >+ 0 >+ [% END %]/160 characters</span> > [% END %] > <table> > <tr> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >index 2d61b53590..c29aabb6a1 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >@@ -223,7 +223,7 @@ > <script>var readCookie;</script> > [% END %] > >-[% IF Koha.Preference( 'opacuserlogin' ) == 1 %][% IF Koha.Preference( 'TagsEnabled' ) == 1 %][% Asset.js("js/tags.js") | $raw %][% END %][% ELSE %][% END %] >+[% IF Koha.Preference( 'opacuserlogin' ) == 1 %][% IF Koha.Preference( 'TagsEnabled' ) == 1 %][% Asset.js("js/tags.js") | $raw %][% END %][% END %] > [% IF ( GoogleJackets ) %] > [% Asset.js("js/google-jackets.js") | $raw %] > <script> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >index e1a9520ac2..b0578c55d1 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >@@ -1304,7 +1304,11 @@ > [% IF Koha.Preference('OverDriveCirculation') %] > [% Asset.js("js/overdrive.js") | $raw %] > <script> >- var OD_password_required = [% IF Koha.Preference('OverDrivePasswordRequired') %]1[% ELSE %]0[% END %]; >+ [%- IF Koha.Preference('OverDrivePasswordRequired') -%] >+ var OD_password_required = 1; >+ [%- ELSE -%] >+ var OD_password_required = 0; >+ [%- END -%] > $(document).ready(function() { > [% IF ( overdrive_error ) %] > KOHA.OverDriveCirculation.display_error("#opac-user-overdrive", "[% overdrive_error.dquote | html %]"); >-- >2.30.2
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 30991
:
136408
|
136429
|
136554