Bug 12056: fix untranslatable strings in calendar
authorOwen Leonard <oleonard@myacpl.org>
Wed, 9 Apr 2014 13:08:27 +0000 (09:08 -0400)
committerKyle M Hall <kyle@bywatersolutions.com>
Wed, 13 Aug 2014 13:40:08 +0000 (09:40 -0400)
In the calendar there are some strings in a JavaScript function which
are not properly wrapped in a function for translation. This patch
corrects this.

This patch also corrects some minor validation issues and spelling and
grammar issues, including those covered by Bug 12055.

To test, apply the patch and view the calendar in Tools -> Calendar.
When you hover your mouse over a day in the calendar you should see a
title tooltip indicating what kind of day/holiday it is and showing the
title of the holiday, if any.

To test that the strings are now being picked up for translation,
run translate update on a po file and confirm that the affected strings
are now present: "Weekly holiday," "Yearly holiday," etc.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Works well. New strings on translation file. No koha-qa errors.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 0837954cdda85549f5552dacefd3a5bc3e58292e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 754caccf77595840701fdad400fa02a298993344)

koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt

index 33ffa28..eb14a31 100644 (file)
@@ -6,12 +6,12 @@
 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
 [% INCLUDE 'datatables-strings.inc' %]
 <script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
-<script language="JavaScript" type="text/javascript">
+<script type="text/javascript">
 //<![CDATA[
     [% IF (dateformat == 'metric') %]dt_add_type_uk_date();[% END %]
     var weekdays = new Array(_("Sundays"),_("Mondays"),_("Tuesdays"),_("Wednesdays"),_("Thursdays"),_("Fridays"),_("Saturdays"));
 
-    /* Creates all the structures to deal with all diferents kinds of holidays */
+    /* Creates all the structures to deal with all different kinds of holidays */
     var week_days = new Array();
     var holidays = new Array();
     var holidates = new Array();
         var dayMonth = month + '/' + day;
         var dateString = year + '/' + month + '/' + day;
         if (exception_holidays[dateString] != null) {
-            return [true, "exception", "Exception: "+exception_holidays[dateString].title];
+            return [true, "exception", _("Exception") + ": "+exception_holidays[dateString].title];
         } else if ( week_days[weekDay] != null ){
-            return [true, "repeatableweekly", "Weekly holdiay: "+week_days[weekDay].title];
+            return [true, "repeatableweekly", _("Weekly holiday") + ": "+week_days[weekDay].title];
         } else if ( day_month_holidays[dayMonth] != null ) {
-            return [true, "repeatableyearly", "Yearly holdiay: "+day_month_holidays[dayMonth].title];
+            return [true, "repeatableyearly", _("Yearly holiday") + ": "+day_month_holidays[dayMonth].title];
         } else if (holidays[dateString] != null) {
-            return [true, "holiday", "Single holiday: "+holidays[dateString].title];
+            return [true, "holiday", _("Single holiday") + ": "+holidays[dateString].title];
         } else {
-            return [true, "normalday", "Normal day"];
+            return [true, "normalday", _("Normal day")];
         }
     }
 
@@ -272,9 +272,10 @@ td.repeatableyearly a.ui-state-default {  background:  #FFCC66 none; color :  Bl
                 <input type="text" id="datecancelrange" name="datecancelrange" size="20" value="[% datecancelrange %]" class="datepicker"/>
             </li>
             <li><label for="showTitle">Title: </label><input type="text" name="showTitle" id="showTitle" size="35" /></li>
-            <!-- showTitle is necessary for exception radio button to work properly --> 
+            <!-- showTitle is necessary for exception radio button to work properly -->
+            <li>
                 <label for="showDescription">Description:</label>
-                <textarea rows="2" cols="40" id="showDescription" name="showDescription"></textarea>    
+                <textarea rows="2" cols="40" id="showDescription" name="showDescription"></textarea>
             </li>
             <li class="radio"><div id="exceptionPosibility" style="position:static">
                 <input type="radio" name="showOperation" id="showOperationExc" value="exception" /> <label for="showOperationExc">Generate an exception for this repeated holiday.</label>
@@ -282,7 +283,7 @@ td.repeatableyearly a.ui-state-default {  background:  #FFCC66 none; color :  Bl
                 <div class="hint">You can make an exception for this holiday rule. This means that you will be able to say that for a repeatable holiday there is one day which is going to be an exception.</div>
             </div></li>
             <li class="radio"><input type="radio" name="showOperation" id="showOperationExcRange" value="exceptionrange" />
-                <label for="newOperationFieldException">Generate exceptions on a range of dates.</label>
+                <label for="showOperationExcRange">Generate exceptions on a range of dates.</label>
                 <a href="#" class="helptext">[?]</a>
                 <div class="hint">You can make an exception on a range of dates repeated yearly.</div>
             </li>
@@ -307,7 +308,7 @@ td.repeatableyearly a.ui-state-default {  background:  #FFCC66 none; color :  Bl
             </ol>
             <fieldset class="action">
                 <input type="submit" name="submit" value="Save" />
-                <a href="#" class="cancel" name="cancel2" onclick=" hidePanel('showHoliday');">Cancel</a>
+                <a href="#" class="cancel" onclick=" hidePanel('showHoliday');">Cancel</a>
             </fieldset>
             </fieldset>
         </form>
@@ -348,7 +349,7 @@ td.repeatableyearly a.ui-state-default {  background:  #FFCC66 none; color :  Bl
             <li class="radio"><input type="radio" name="newOperation" id="newOperationOnce" value="holiday" checked="checked" />
             <label for="newOperationOnce">Holiday only on this day</label>.
             <a href="#" class="helptext">[?]</a>
-            <div class="hint">Make a single holiday. For example, selecting August 1st, 2012 will make it a holiday, but will not affect August 1st in other years.</div>
+            <div class="hint">Make a single holiday. For example, selecting August 1, 2012 will make it a holiday, but will not affect August 1 in other years.</div>
             </li>
             <li class="radio"><input type="radio" name="newOperation" id="newOperationDay" value="weekday" />
                             <label for="newOperationDay">Holiday repeated every same day of the week</label>.
@@ -358,17 +359,17 @@ td.repeatableyearly a.ui-state-default {  background:  #FFCC66 none; color :  Bl
             <li class="radio"><input type="radio" name="newOperation" id="newOperationYear" value="repeatable" />
                             <label for="newOperationYear">Holiday repeated yearly on the same date</label>.
                             <a href="#" class="helptext">[?]</a>
-                            <div class="hint">This will take this day and month as a reference to make it a holiday. Through this option, you can repeat this rule for every year. For example, selecting August 1st will make August 1st a holiday every year.</div>
+                            <div class="hint">This will take this day and month as a reference to make it a holiday. Through this option, you can repeat this rule for every year. For example, selecting August 1 will make August 1 a holiday every year.</div>
                             </li>
             <li class="radio"><input type="radio" name="newOperation" id="newOperationField" value="holidayrange" />
                             <label for="newOperationField">Holidays on a range</label>.
                             <a href="#" class="helptext">[?]</a>
-                            <div class="hint">Make a single holiday on a range. For example, selecting August 1st, 2012  and August 10st, 2012 will make all days between 1st and 10st holiday, but will not affect August 1-10 in other years.</div>
+                            <div class="hint">Make a single holiday on a range. For example, selecting August 1, 2012  and August 10, 2012 will make all days between August 1 and 10 a holiday, but will not affect August 1-10 in other years.</div>
                             </li>
             <li class="radio"><input type="radio" name="newOperation" id="newOperationFieldyear" value="holidayrangerepeat" />
                             <label for="newOperationFieldyear">Holidays repeated yearly on a range</label>.
                             <a href="#" class="helptext">[?]</a>
-                            <div class="hint">Make a single holiday on a range repeated yearly. For example, selecting August 1st, 2012  and August 10st, 2012 will make all days between 1st and 10st holiday, and will affect August 1-10 in other years.</div>
+                            <div class="hint">Make a single holiday on a range repeated yearly. For example, selecting August 1, 2012  and August 10, 2012 will make all days between August 1 and 10 a holiday, and will affect August 1-10 in other years.</div>
                             </li>
                 <li class="radio">
                 <input type="checkbox" name="allBranches" id="allBranches" />
@@ -378,7 +379,7 @@ td.repeatableyearly a.ui-state-default {  background:  #FFCC66 none; color :  Bl
                 </li></ol>
                 <fieldset class="action">
                     <input type="submit" name="submit" value="Save" />
-                    <a href="#" class="cancel" name="cancel2" onclick=" hidePanel('newHoliday');">Cancel</a>
+                    <a href="#" class="cancel" onclick=" hidePanel('newHoliday');">Cancel</a>
                 </fieldset>
                 </fieldset>
          </form>
@@ -415,7 +416,7 @@ td.repeatableyearly a.ui-state-default {  background:  #FFCC66 none; color :  Bl
     <ul>
         <li>Search in the calendar the day you want to set as holiday.</li>
         <li>Click the date to add or edit a holiday.</li>
-        <li>Enter a title and description for the holdiay.</li>
+        <li>Enter a title and description for the holiday.</li>
         <li>Specify how the holiday should repeat.</li>
         <li>Click Save to finish.</li>
     </ul>