Bug 12056 - Untranslatable strings in calendar
Summary: Untranslatable strings in calendar
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
: 12055 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-04-09 11:07 UTC by paxed
Modified: 2015-06-04 23:30 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 12056 - Untranslatable strings in calendar (10.27 KB, patch)
2014-04-09 13:18 UTC, Owen Leonard
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 12056 - Untranslatable strings in calendar (10.37 KB, patch)
2014-04-09 21:00 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
[PASSED QA] Bug 12056 - Untranslatable strings in calendar (10.47 KB, patch)
2014-04-09 21:47 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description paxed 2014-04-09 11:07:08 UTC
In the calendar, the javascript function dateStatusHandler() returns eg. "Single holiday: " + the name of the holiday. The string is not picked up for translation.

In total, the function has 5 different strings that are not picked up.
Comment 1 Owen Leonard 2014-04-09 13:18:24 UTC Comment hidden (obsolete)
Comment 2 Mark Tompsett 2014-04-09 17:58:05 UTC
Comment on attachment 26920 [details] [review]
Bug 12056 - Untranslatable strings in calendar

Review of attachment 26920 [details] [review]:
-----------------------------------------------------------------

Okay. Eyeballed. Now to test.

::: koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt
@@ +4,4 @@
>  [% INCLUDE 'calendar.inc' %]
>  <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
>  [% INCLUDE 'datatables.inc' %]
> +<script type="text/javascript">

Simplified. Removed deprecated language tag (http://www.w3.org/TR/html401/interact/scripts.html section 18.2).

@@ +8,4 @@
>  //<![CDATA[
>      var weekdays = new Array(_("Sundays"),_("Mondays"),_("Tuesdays"),_("Wednesdays"),_("Thursdays"),_("Fridays"),_("Saturdays"));
>  
> +    /* Creates all the structures to deal with all different kinds of holidays */

Corrected spelling of different on comment.

@@ +120,2 @@
>          } else if ( week_days[weekDay] != null ){
> +            return [true, "repeatableweekly", _("Weekly holiday") + ": "+week_days[weekDay].title];

Corrected spelling of holiday.

@@ +122,2 @@
>          } else if ( day_month_holidays[dayMonth] != null ) {
> +            return [true, "repeatableyearly", _("Yearly holiday") + ": "+day_month_holidays[dayMonth].title];

Corrected spelling of holiday.

@@ +126,2 @@
>          } else {
> +            return [true, "normalday", _("Normal day")];

The _() around the string makes it able to be translated, hence these changes.

@@ +274,2 @@
>                  <label for="showDescription">Description:</label>
> +                <textarea rows="2" cols="40" id="showDescription" name="showDescription"></textarea>

White space clean up.

@@ +280,4 @@
>                  <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="showOperationExcRange">Generate exceptions on a range of dates.</label>

Corrected the for attribute value.

@@ +305,4 @@
>              </ol>
>              <fieldset class="action">
>                  <input type="submit" name="submit" value="Save" />
> +                <a href="#" class="cancel" onclick=" hidePanel('showHoliday');">Cancel</a>

Removed name attribute and value. Not in HTML 5.

@@ -359,5 @@
>                              </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>

10st?! Glad this is getting fixed.

@@ +365,5 @@
>                              </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 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>

Whole bunch of 'st' removals and cleanups.

@@ +376,4 @@
>                  </li></ol>
>                  <fieldset class="action">
>                      <input type="submit" name="submit" value="Save" />
> +                    <a href="#" class="cancel" onclick=" hidePanel('newHoliday');">Cancel</a>

Removed name attribute and value. Name attribute does not exist in HTML 5.

@@ +413,4 @@
>      <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 holiday.</li>

Corrected spelling of holiday.
Comment 3 Bernardo Gonzalez Kriegel 2014-04-09 21:00:25 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2014-04-09 21:47:09 UTC
Created attachment 26939 [details] [review]
[PASSED QA] Bug 12056 - Untranslatable strings in calendar

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.
Comment 5 Galen Charlton 2014-04-09 22:14:30 UTC
Pushed to master.  Thanks, Owen!
Comment 6 Mark Tompsett 2014-04-10 03:31:20 UTC
*** Bug 12055 has been marked as a duplicate of this bug. ***
Comment 7 Fridolin Somers 2014-08-01 14:08:51 UTC
Pushed to 3.14.x, will be in 3.14.10
Comment 8 Kyle M Hall 2014-08-13 13:43:14 UTC
Picked for 3.12.15