From c19add2306c978784402f58e84ab48d164f62ed1 Mon Sep 17 00:00:00 2001 From: Alex Buckley 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 --- .../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 %] - [% IF ( c == undef ) %]1[% ELSE %]0[% END %] + [% IF ( c == undef ) %] + 1 + [% ELSE %] + 0 + [% END %] [% IF c == undef %] All @@ -210,7 +214,11 @@ [% Categories.GetName(c) | html %] [% END %] - [% IF ( i == undef ) %]1[% ELSE %]0[% END %] + [% IF ( i == undef ) %] + 1 + [% ELSE %] + 0 + [% END %] [% IF i == undef %] All 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 @@ [% END %] -
  • Total checkouts:[% IF ( ITEM_DAT.issues ) %][% ITEM_DAT.issues | html %][% ELSE %]0[% END %] (View item's checkout history)
  • +
  • Total checkouts: + [% IF ( ITEM_DAT.issues ) %] + [% ITEM_DAT.issues | html %] + [% ELSE %] + 0 + [% END %] (View item's checkout history)
  • Last seen:[% IF ( ITEM_DAT.datelastseen ) %][% ITEM_DAT.datelastseen | $KohaDates %] [%END %] 
  • Last borrowed:[% IF (ITEM_DAT.datelastborrowed ) %][% ITEM_DAT.datelastborrowed | $KohaDates %][% END %] 
  • 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 @@
  • [% IF letter.message_transport_type == 'sms' %] - [% IF letter.content && letter.content.length > 0 %][% letter.content.length | html %][% ELSE %]0[% END %]/160 characters + + [% IF letter.content && letter.content.length > 0 %] + [% letter.content.length | html %] + [% ELSE %] + 0 + [% END %]/160 characters [% END %] 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 @@ [% 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 %]