Bug 11497: remove TT construct for picking a default string that i18n toolchain fails...
authorBernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Thu, 3 Apr 2014 18:58:08 +0000 (15:58 -0300)
committerGalen Charlton <gmc@esilibrary.com>
Sun, 27 Apr 2014 21:23:01 +0000 (21:23 +0000)
The i18n toolchain fails to pick up constant text defined inside
[% ... %].  In particular, in a construct like this

  [% var OR "string" %]

the string "string" will not be available to be translated.

This patch fixes all the cases I could find.

To test:
1. Update your preferred language
(cd misc/translator; perl translate update fi-FI)

2. Count headers for example
egrep "^msgid.*Koha online" misc/translator/po/fi-FI-* | wc -l

3. Apply the patch

4. Repeat 1 and 2, now there are more lines
Or translate to some lang and visit every touched page and look the title

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described. Template changes only.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
12 files changed:
koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt
koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-review.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags_subject.tt
koha-tmpl/opac-tmpl/prog/en/modules/ilsdi.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-review.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-tags_subject.tt

index 4da56af..4936041 100644 (file)
@@ -167,7 +167,7 @@ function populateHiddenCheckboxes(tab) {
 [% INCLUDE 'cat-search.inc' %]
 
 <div id="breadcrumbs">
-  <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; <a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC frameworks</a> &rsaquo; <a href="/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=[% frameworkcode %]&amp;searchfield=[% tagfield %]">[% frameworkcode or "Default" %] framework structure</a> &rsaquo;
+  <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; <a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC frameworks</a> &rsaquo; <a href="/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=[% frameworkcode %]&amp;searchfield=[% tagfield %]">[% IF ( frameworkcode ) %][% frameworkcode %][% ELSE %]Default[% END %] framework structure</a> &rsaquo;
   [% IF ( add_form ) %]
   [% IF ( use_heading_flags_p ) %]
   [% IF ( heading_edit_subfields_p ) %] <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield %]&amp;frameworkcode=[% frameworkcode %]">Tag [% tagfield %] subfield structure</a> &rsaquo; Edit subfields constraints
index c414787..9203d9e 100644 (file)
@@ -173,7 +173,7 @@ $(document).ready(function() {
         [% ELSE %]
                        <tr>
         [% END %]
-                               <td>[% lette.branchname || "(All libraries)" %]</td>
+                               <td>[% IF ( lette.branchname ) %][% lette.branchname %][% ELSE %](All libraries)[% END %]</td>
                                <td>[% lette.module %]</td>
                                <td>[% lette.code %]</td>
                                <td>[% lette.name %]</td>
index ac7b2b2..9421fa2 100644 (file)
@@ -1,5 +1,6 @@
 [% USE Koha %]
-[% INCLUDE 'doc-head-open.inc' %][% LibraryNameTitle or "Koha online" %] catalog &rsaquo;
+[% INCLUDE 'doc-head-open.inc' %]
+[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo;
     [% IF ( GetAvailability ) %]
         ILS-DI &rsaquo; GetAvailability
     [% ELSIF ( GetRecords ) %]
     </div> <!-- / .main -->
 
 [% INCLUDE 'opac-bottom.inc' %]
-[% BLOCK jsinclude %][% END %]
\ No newline at end of file
+[% BLOCK jsinclude %][% END %]
index 584e0e3..983dcc8 100644 (file)
@@ -1,7 +1,7 @@
 [% USE Koha %]
 [% USE KohaDates %]
-
-[% INCLUDE 'doc-head-open.inc' %][% LibraryNameTitle or "Koha online" %] catalog &rsaquo; Your checkout history
+[% INCLUDE 'doc-head-open.inc' %]
+[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your checkout history
 [% INCLUDE 'doc-head-close.inc' %]
 [% BLOCK cssinclude %]
     <style type="text/css">ul.ui-tabs-nav li a, ul.ui-tabs-nav li span.a  { padding:0.6em 1em; }</style>
index d42323c..f551584 100644 (file)
@@ -1,6 +1,7 @@
 [% USE Koha %]
 [% USE KohaDates %]
-[% INCLUDE 'doc-head-open.inc' %][% LibraryNameTitle or "Koha online" %] catalog &rsaquo;  Placing a hold
+[% INCLUDE 'doc-head-open.inc' %]
+[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Placing a hold
 [% INCLUDE 'doc-head-close.inc' %]
 [% BLOCK cssinclude %][% END %]
 </head>
index f77b650..7f24db6 100644 (file)
@@ -1,4 +1,5 @@
-[% INCLUDE 'doc-head-open.inc' %][% LibraryNameTitle or "Koha online" %] catalog &rsaquo; Comments on [% title |html %]
+[% INCLUDE 'doc-head-open.inc' %]
+[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Comments on [% title |html %]
 <style type="text/css">
   #custom-doc { width:37.08em;*width:36.16em;min-width:485px; margin:1em auto; text-align:left; }
 </style>
index a79ff9f..a5658f0 100644 (file)
@@ -1,5 +1,6 @@
 [% USE Koha %]
-[% INCLUDE 'doc-head-open.inc' %][% LibraryNameTitle or "Koha online" %] catalog &rsaquo;  Subject cloud
+[% INCLUDE 'doc-head-open.inc' %]
+[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Subject cloud
 [% INCLUDE 'doc-head-close.inc' %]
 [% BLOCK cssinclude %][% END %]
 </head>
@@ -57,4 +58,4 @@
     </div> <!-- / .main -->
 
 [% INCLUDE 'opac-bottom.inc' %]
-[% BLOCK jsinclude %][% END %]
\ No newline at end of file
+[% BLOCK jsinclude %][% END %]
index a727b29..9eb09be 100644 (file)
@@ -1,4 +1,5 @@
-[% INCLUDE 'doc-head-open.inc' %][% LibraryNameTitle or "Koha online" %] &rsaquo; ILS-DI
+[% INCLUDE 'doc-head-open.inc' %]
+[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; ILS-DI
 [% INCLUDE 'doc-head-close.inc' %]
 </head>
 <body>
index 7ee7e12..3a849c9 100644 (file)
@@ -1,6 +1,7 @@
 [% USE Koha %]
 [% USE KohaDates %]
-[% INCLUDE 'doc-head-open.inc' %][% LibraryNameTitle or "Koha online" %] catalog &rsaquo; Your checkout history
+[% INCLUDE 'doc-head-open.inc' %]
+[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your checkout history
 [% INCLUDE 'doc-head-close.inc' %]
 <style type="text/css">ul.ui-tabs-nav li a, ul.ui-tabs-nav li span.a  { padding:0.6em 1em; }</style>
 <script type="text/javascript">
index 0932d20..9c63089 100644 (file)
@@ -1,6 +1,7 @@
 [% USE Koha %]
 [% USE KohaDates %]
-[% INCLUDE 'doc-head-open.inc' %][% LibraryNameTitle or "Koha online" %] catalog &rsaquo;  Placing a hold
+[% INCLUDE 'doc-head-open.inc' %]
+[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Placing a hold
 [% INCLUDE 'doc-head-close.inc' %]
 [% INCLUDE 'calendar.inc' %]
 <script type="text/javascript">
index 3df04b4..2641f0f 100644 (file)
@@ -1,4 +1,5 @@
-[% INCLUDE 'doc-head-open.inc' %][% LibraryNameTitle or "Koha online" %] catalog &rsaquo; Comments on [% title |html %]
+[% INCLUDE 'doc-head-open.inc' %]
+[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Comments on [% title |html %]
 <style type="text/css">
   #custom-doc { width:37.08em;*width:36.16em;min-width:485px; margin:1em auto; text-align:left; }
 </style>
index f84bf77..ebd5149 100644 (file)
@@ -1,5 +1,6 @@
 [% USE Koha %]
-[% INCLUDE 'doc-head-open.inc' %][% LibraryNameTitle or "Koha online" %] catalog &rsaquo;  ISBD
+[% INCLUDE 'doc-head-open.inc' %]
+[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; ISBD
 [% INCLUDE 'doc-head-close.inc' %]
 </head>
 <body id="opac-tags-subject">