Bug 18641 - Translatability: Get rid of template directives in translations for ...
authorMarc Véron <veron@veron.ch>
Sat, 20 May 2017 07:18:10 +0000 (09:18 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 9 Jun 2017 13:03:55 +0000 (10:03 -0300)
Template directives should not be exposed in translation, but lines like the following pop up in the translation tool:
Cancel [% IF TransferWhenCancelAllWaitingHolds %]and Transfer [% END %] All

This patch fixes it.

To test:
- Apply patch
- Verify that code changes make sense
- Verify that submit buttons of pendingreserves.tt and waitingreserves.tt
  still work and display the same string as before

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 18641: (RM-followup) for waitingreserves.tt

Code changed for waitingreserves.tt as asked for in comment #7

Bug 18641: Followup for pendingreserves.tt (less %s)

Change as of comment #13 to reduce %s

After creating a new translation for a "language" aa-AA, we have
the following in the file aa-AA-staff-prog.po

msgid ""
"(Inclusive, default is %s days ago to %s days ahead. Set other date ranges "
"as needed.)"
msgstr ""

msgid ""
"(Inclusive, default is %s days ago to today. Set other date ranges as "
"needed.)"
msgstr ""

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt
koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt

index 7017465..62cdc26 100644 (file)
@@ -195,7 +195,13 @@ $(document).ready(function() {
 <input type="text" size="10" id="to" name="to" value="[% to | $KohaDates %]" class="datepickerto" />
 </li>
 </ol>
-<p><i>(Inclusive, default is [% HoldsToPullStartDate %] days ago to [% IF ( HoldsToPullEndDate ) %][% HoldsToPullEndDate %] days ahead[% ELSE %]today[% END %], set other date ranges as needed. )</i></p>
+
+[% IF ( HoldsToPullEndDate ) %]
+    <p><i>(Inclusive, default is [% HoldsToPullStartDate %] days ago to [% HoldsToPullEndDate %] days ahead. Set other date ranges as needed.)</i></p>
+[% ELSE %]
+    <p><i>(Inclusive, default is [% HoldsToPullStartDate %] days ago to today. Set other date ranges as needed.)</i></p>
+[% END %]
+
 <fieldset class="action"><input type="submit" name="run_report" value="Submit" class="submit"/></fieldset>
 </fieldset>
 </form>
index 80af602..e0f7169 100644 (file)
         <div id="holdsover">
                 [% IF ( ReservesMaxPickUpDelay ) %]<p>Holds listed here have been awaiting pickup for more than [% ReservesMaxPickUpDelay %] days.</p>[% END %]
                [% IF ( overloop ) %]
-
                <form name="cancelAllReserve" action="waitingreserves.pl" method="post">
                    <input type="hidden" name="cancelall" value="1" />
                    <input type="hidden" name="allbranches" value="[% allbranches %]" />
                    <input type="hidden" name="tab" value="holdsover">
-                   <input type="submit" value="Cancel [% IF TransferWhenCancelAllWaitingHolds %]and Transfer [% END %]All" />
+                   [% IF TransferWhenCancelAllWaitingHolds %]
+                       <input type="submit" value="Cancel and Transfer all" />
+                   [% ELSE %]
+                       <input type="submit" value="Cancel all" />
+                   [% END %]
                </form>
                [% UNLESS TransferWhenCancelAllWaitingHolds %]
                     Only items that need not be transferred will be cancelled (TransferWhenCancelAllWaitingHolds sypref)