From 714075d5c18fb2ced51461b0300158b71c78c48c Mon Sep 17 00:00:00 2001 From: Fridolyn SOMERS Date: Wed, 28 Nov 2012 15:37:22 +0100 Subject: [PATCH] Bug 8942: Translation process breaks javascript Signed-off-by: Owen Leonard I tested most scripts affected by this patch and visually verified all changes. Functionality is unaffected. Signed-off-by: Mason James Signed-off-by: Jared Camins-Esakov --- .../prog/en/includes/calendar.inc | 24 +++++++++---------- .../prog/en/includes/cat-toolbar.inc | 2 +- .../prog/en/includes/members-toolbar.inc | 4 ++-- koha-tmpl/intranet-tmpl/prog/en/js/acq.js | 2 +- koha-tmpl/intranet-tmpl/prog/en/js/ajax.js | 8 +++---- .../prog/en/modules/acqui/basket.tt | 10 ++++---- .../prog/en/modules/acqui/neworderempty.tt | 2 +- .../prog/en/modules/acqui/orderreceive.tt | 8 +++++++ .../prog/en/modules/acqui/parcel.tt | 4 ++-- .../prog/en/modules/admin/biblio_framework.tt | 4 ++-- .../modules/admin/item_circulation_alerts.tt | 8 +++---- .../prog/en/modules/cataloguing/merge.tt | 2 +- .../prog/en/modules/labels/label-manage.tt | 4 ++-- .../prog/en/modules/members/moremember.tt | 4 ++-- .../prog/en/modules/offline_circ/list.tt | 4 ++-- .../en/modules/offline_circ/process_koc.tt | 2 +- .../prog/en/modules/patroncards/manage.tt | 8 +++---- .../prog/en/modules/reserve/request.tt | 8 +++---- .../prog/en/modules/serials/claims.tt | 8 +++---- .../prog/en/modules/tags/review.tt | 4 ++-- .../prog/en/modules/tools/holidays.tt | 8 +++---- .../prog/en/modules/tools/quotes-upload.tt | 12 +++++----- .../prog/en/modules/tools/quotes.tt | 10 ++++---- .../en/modules/tools/stage-marc-import.tt | 2 +- .../prog/en/modules/tools/upload-images.tt | 2 +- .../prog/en/modules/virtualshelves/shelves.tt | 6 ++--- .../prog/en/modules/opac-results-grouped.tt | 4 ++-- .../opac-tmpl/prog/en/modules/opac-results.tt | 4 ++-- .../opac-tmpl/prog/en/modules/opac-review.tt | 2 +- .../opac-tmpl/prog/en/modules/opac-shelves.tt | 6 ++--- .../prog/en/modules/opac-suggestions.tt | 4 ++-- 31 files changed, 94 insertions(+), 86 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc index fc8a1a380d..f0552e8c22 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc @@ -25,18 +25,18 @@ function Date_from_syspref(dstring) { jQueryUI we expose the localization strings in the default configuration */ jQuery(function($){ $.datepicker.regional[''] = { - closeText: _('Done'), - prevText: _('Prev'), - nextText: _('Next'), - currentText: _('Today'), - monthNames: [_('January'),_('February'),_('March'),_('April'),_('May'),_('June'), - _('July'),_('August'),_('September'),_('October'),_('November'),_('December')], - monthNamesShort: [_('Jan'), _('Feb'), _('Mar'), _('Apr'), _('May'), _('Jun'), - _('Jul'), _('Aug'), _('Sep'), _('Oct'), _('Nov'), _('Dec')], - dayNames: [_('Sunday'), _('Monday'), _('Tuesday'), _('Wednesday'), _('Thursday'), _('Friday'), _('Saturday')], - dayNamesShort: [_('Sun'), _('Mon'), _('Tue'), _('Wed'), _('Thu'), _('Fri'), _('Sat')], - dayNamesMin: [_('Su'),_('Mo'),_('Tu'),_('We'),_('Th'),_('Fr'),_('Sa')], - weekHeader: _('Wk'), + closeText: _("Done"), + prevText: _("Prev"), + nextText: _("Next"), + currentText: _("Today"), + monthNames: [_("January"),_("February"),_("March"),_("April"),_("May"),_("June"), + _("July"),_("August"),_("September"),_("October"),_("November"),_("December")], + monthNamesShort: [_("Jan"), _("Feb"), _("Mar"), _("Apr"), _("May"), _("Jun"), + _("Jul"), _("Aug"), _("Sep"), _("Oct"), _("Nov"), _("Dec")], + dayNames: [_("Sunday"), _("Monday"), _("Tuesday"), _("Wednesday"), _("Thursday"), _("Friday"), _("Saturday")], + dayNamesShort: [_("Sun"), _("Mon"), _("Tue"), _("Wed"), _("Thu"), _("Fri"), _("Sat")], + dayNamesMin: [_("Su"),_("Mo"),_("Tu"),_("We"),_("Th"),_("Fr"),_("Sa")], + weekHeader: _("Wk"), dateFormat: '[% IF ( dateformat_us ) %]mm/dd/yy[% ELSIF ( dateformat_metric ) %]dd/mm/yy[% ELSE %]yy-mm-dd[% END %]', firstDay: [% CalendarFirstDayOfWeek %], isRTL: [% IF ( bidi ) %]true[% ELSE %]false[% END %], diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc index f8e6b4ae97..b2c3d60690 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc @@ -31,7 +31,7 @@ function confirm_deletion() { if (count>0){ is_confirmed= alert(_('There are [ '+ count +' ] item(s) attached to this record \n You must delete all items before deleting this record.')); } else{ - is_confirmed= confirm(_('Are you sure you want to delete this record? ')); + is_confirmed= confirm(_("Are you sure you want to delete this record? ")); } if (is_confirmed) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc index 91d179e60a..bfa923d67d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc @@ -3,14 +3,14 @@ // // // // diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index bbb5cab5ad..39f3e551b6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -39,14 +39,14 @@ $(document).ready(function() { [% IF ( picture ) %] // new YAHOO.widget.Button("delpicture"); // FIXME: formatting mismatch between YUI and normal button $('#delpicture').click(function(){ - return confirm(_('Are you sure you want to delete this patron image? This cannot be undone.')); + return confirm(_("Are you sure you want to delete this patron image? This cannot be undone.")); }); $('#manage-patron-image').find("input[value*=Upload]").click(function(){ if($("#uploadfile").val() == ""){ alert(_("Please choose a file to upload")); return false; } - return confirm(_('Are you sure you want to replace the current patron image? This cannot be undone.')); + return confirm(_("Are you sure you want to replace the current patron image? This cannot be undone.")); });[% END %] $("#renew_all" ).click(function(){ $(".checkboxed").checkCheckboxes(":input[name*=items]" ); $(".checkboxed").unCheckCheckboxes(":input[name*=barcodes]"); }); $("#CheckAllitems" ).click(function(){ $(".checkboxed").checkCheckboxes(":input[name*=items]" ); $(".checkboxed").unCheckCheckboxes(":input[name*=barcodes]"); return false; }); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/list.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/list.tt index d22cf5f0bc..40c34464c4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/list.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/list.tt @@ -7,8 +7,8 @@ //"+_('Uncheck all')+"<\/a>"); - $("span.checkall").html(""+_('Check all')+"<\/a>"); + $("span.clearall").html(""+_("Uncheck all")+"<\/a>"); + $("span.checkall").html(""+_("Check all")+"<\/a>"); $('#CheckNone').click(function() { $("#operations").unCheckCheckboxes(); return false; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/process_koc.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/process_koc.tt index b818039cec..0aae78b83a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/process_koc.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/process_koc.tt @@ -18,7 +18,7 @@ function CheckUpload(f){ } function CheckForm(f) { if (f.uploadedfileid.value == '') { - alert(_('Please upload a file first.')); + alert(_("Please upload a file first.")); } else { $("#fileuploadstatus").hide(); $("#fileuploadform").slideUp(); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/manage.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/manage.tt index 13f4dc27a9..afb466b383 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/manage.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/manage.tt @@ -38,7 +38,7 @@ } } if (batches.length < 1) { - alert(_('Please select at least one batch to export.')); + alert(_("Please select at least one batch to export.")); return; // no batch selected } getstr = batches.join("&"); @@ -47,7 +47,7 @@ getstr = "batch_id="+document.layouts.action.value; } else { - alert(_('Please select at least one batch to export.')); + alert(_("Please select at least one batch to export.")); return; // no batch selected } return GB_showCenter('Export Patron Cards', "/cgi-bin/koha/patroncards/print.pl?" + getstr, 700, 800); @@ -64,7 +64,7 @@ return(document.layouts.action[selected[0]].value); } else { - alert(_('Please select only one ')+'[% card_element %]'+_(' to ') + op + '.'); + alert(_("Please select only one ")+"[% card_element %]"+_(" to ") + op + "."); return (-1); } } @@ -73,7 +73,7 @@ return(document.layouts.action.value); } }; - alert(_('Please select a ')+'[% card_element %].'); + alert(_("Please select a ")+"[% card_element %]."); return (-1); }; //]]> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt index 05470ebbf3..e9a59148b8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -97,16 +97,16 @@ function checkMultiHold() { var msg = ''; switch (override_items[itemnumber].holdallowed) { - case 0: msg = _( 'This item normally cannot be put on hold.' ); break; - case 1: msg = _( 'This item normally cannot be put on hold except for patrons from ' ) + override_items[itemnumber].homebranch + '.'; break; + case 0: msg = _("This item normally cannot be put on hold."); break; + case 1: msg = _("This item normally cannot be put on hold except for patrons from ") + override_items[itemnumber].homebranch + "."; break; } - msg += "\n\n" + _( 'Place hold on this item?' ); + msg += "\n\n" + _("Place hold on this item?"); return confirm(msg); }); $("input.warning").click(function() { - return confirm( _( 'None of these items can normally be put on hold for this patron.' ) + "\n\n" + _( 'Place hold?' ) ); + return confirm( _("None of these items can normally be put on hold for this patron.") + "\n\n" + _("Place hold?") ); }); $("#requestany").click(function() { if(this.checked){ diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt index c1f3aa15ff..61b19a8080 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt @@ -38,7 +38,7 @@ var selected = $("input:checked"); if (selected.length == 0) { - alert(_('Please select at least one item to export.')); + alert(_("Please select at least one item to export.")); return false; } @@ -64,7 +64,7 @@ // Checks if the form can be sent (at least one checkbox must be checked) function checkForm() { if ($("input:checked").length == 0) { - alert(_('Please select at least one item.')); + alert(_("Please select at least one item.")); return false; } } @@ -97,13 +97,13 @@ // Checks if the beginning date is valid if (!parseInt(beginDate)) { - alert(_('The beginning date is missing or invalid.')); + alert(_("The beginning date is missing or invalid.")); return false; } // Checks if the ending date is valid if (!parseInt(endDate)) { - alert(_('The ending date is missing or invalid.')); + alert(_("The ending date is missing or invalid.")); return false; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt index 4569525957..e4af5b0fb9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt @@ -48,13 +48,13 @@ td input,td input[type="submit"] { font-size: 85%; padding: 1px; } } } var success_approve = function(tag){ - // window.alert(_('AJAX approved tag: ') + tag); + // window.alert(_("AJAX approved tag: ") + tag); }; var failure_approve = function(tag){ window.alert(_("AJAX failed to approve tag: ") + tag); }; var success_reject = function(tag){ - // window.alert(_('AJAX rejected tag: ') + tag); + // window.alert(_("AJAX rejected tag: ") + tag); }; var failure_reject = function(tag){ window.alert(_("AJAX failed to reject tag: ") + tag); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt index fa7904feb4..a9e0c96a37 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt @@ -56,16 +56,16 @@ $('#showHolidayType').val(holidayType); if (holidayType == 'exception') { - $("#showOperationDelLabel").html(_('Delete this exception.')); + $("#showOperationDelLabel").html(_("Delete this exception.")); $("#holtype").attr("class","key exception").html(_("Holiday exception")); } else if(holidayType == 'weekday') { - $("#showOperationDelLabel").html(_('Delete this holiday.')); + $("#showOperationDelLabel").html(_("Delete this holiday.")); $("#holtype").attr("class","key repeatableweekly").html(_("Holiday repeating weekly")); } else if(holidayType == 'daymonth') { - $("#showOperationDelLabel").html(_('Delete this holiday.')); + $("#showOperationDelLabel").html(_("Delete this holiday.")); $("#holtype").attr("class","key repeatableyearly").html(_("Holiday repeating yearly")); } else { - $("#showOperationDelLabel").html(_('Delete this holiday.')); + $("#showOperationDelLabel").html(_("Delete this holiday.")); $("#holtype").attr("class","key holiday").html(_("Unique holiday")); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt index 2330ee6c69..19833a61ff 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt @@ -237,12 +237,12 @@ var fileSizeInK = Math.round(evt.target.files[0].size/1024); if (!fileType.match(/comma-separated-values|csv|excel/i)) { - alert(_('Uploads limited to csv. Incorrect filetype: ')+fileType); + alert(_("Uploads limited to csv. Incorrect filetype: ")+fileType); parent.location='quotes-upload.pl'; return; } if (fileSizeInK > 512) { - if (!confirm(evt.target.files[0].name+' '+fileSizeInK+_(' KB Do you really want to upload this file?'))) { + if (!confirm(evt.target.files[0].name+' '+fileSizeInK+_(" KB Do you really want to upload this file?"))) { parent.location='quotes-upload.pl'; return; } @@ -268,11 +268,11 @@ success : function(){ var response = JSON.parse(jqXHR.responseText); if (response.success) { - alert(response.records+_(' quotes saved.')); + alert(response.records+_(" quotes saved.")); window.location.reload(true); // is this the best route? } else { - alert(response.records+_(' quotes saved, but an error has occurred. Please ask your administrator to check the server log for more details.')); + alert(response.records+_(" quotes saved, but an error has occurred. Please ask your administrator to check the server log for more details.")); window.location.reload(true); // is this the best route? } }, @@ -284,9 +284,9 @@ return this.id; }).get().join(', '); if (!idsToDelete) { - alert(_('Please select a quote(s) by clicking the quote id(s) you desire to delete.')); + alert(_("Please select a quote(s) by clicking the quote id(s) you desire to delete.")); } - else if (confirm(_('Are you sure you wish to delete quote(s) ')+idsToDelete+'?')) { + else if (confirm(_("Are you sure you wish to delete quote(s) ")+idsToDelete+"?")) { oTable.$('.selected').each(function(){ oTable.fnDeleteRow(this); }); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes.tt index ea5769c9bb..a16c51a0ff 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes.tt @@ -11,7 +11,7 @@