From 01745dbaf6a5743aa3683e9fe33e7d0cf7d78ed3 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 18 Apr 2011 08:04:52 -0300 Subject: [PATCH] [3.2.x] Bug 6084 - Missing translation markers in javascript alert messages Content-Type: text/plain; charset="utf-8" Wrap alert string with _() so they became translatable. Commented and 'if $debug' lines are ommited in the process. Places to fix where found with To+ I ommited commented lines and "if $debug" lines too. --- .../prog/en/includes/background-job.inc | 2 +- .../intranet-tmpl/prog/en/includes/calendar.inc | 4 ++-- .../prog/en/includes/labels-batches-toolbar.inc | 14 +++++++------- .../en/includes/patroncards-batches-toolbar.inc | 14 +++++++------- koha-tmpl/intranet-tmpl/prog/en/js/acq.js | 4 ++-- .../prog/en/modules/acqui/neworderempty.tmpl | 4 ++-- .../prog/en/modules/admin/cities.tmpl | 2 +- .../prog/en/modules/admin/stopwords.tmpl | 2 +- .../prog/en/modules/cataloguing/additem.tmpl | 2 +- .../modules/cataloguing/value_builder/macles.tmpl | 2 +- .../prog/en/modules/labels/label-manage.tmpl | 8 ++++---- .../prog/en/modules/offline_circ/process_koc.tmpl | 6 +++--- .../prog/en/modules/patroncards/image-manage.tmpl | 2 +- .../prog/en/modules/patroncards/manage.tmpl | 10 +++++----- .../prog/en/modules/serials/checkexpiration.tmpl | 2 +- .../prog/en/modules/serials/serials-recieve.tmpl | 2 +- .../prog/en/modules/tools/cleanborrowers.tmpl | 4 ++-- .../prog/en/modules/tools/stage-marc-import.tmpl | 2 +- koha-tmpl/opac-tmpl/prog/en/includes/calendar.inc | 2 +- .../prog/en/modules/opac-results-grouped.tmpl | 4 ++-- .../opac-tmpl/prog/en/modules/opac-results.tmpl | 4 ++-- .../opac-tmpl/prog/en/modules/opac-review.tmpl | 4 ++-- 22 files changed, 50 insertions(+), 50 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/background-job.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/background-job.inc index 7d65d4d..3adc93a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/background-job.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/background-job.inc @@ -73,7 +73,7 @@ backgroundJobProgressTimer = setInterval("updateJobProgress()", 500); }, error: function(xml, textStatus) { - alert('Failed to submit form: ' + textStatus); + alert(_('Failed to submit form')+': '+ textStatus); } }); diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc index aa6e9c7..8600ed9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc @@ -79,7 +79,7 @@ function Date_from_syspref(dstring) { } else if (dformat === "metric") { return new Date(dateX[2], (dateX[1] - 1), dateX[0]); // DD/MM/YYYY to (YYYY,m(0-11),d) } else { - if (debug > 0) {alert("KOHA ERROR - Unrecognized date format: " +dformat);} + if (debug > 0) {alert(_("KOHA ERROR - Unrecognized date format: ") +dformat);} return 0; } } @@ -92,7 +92,7 @@ function get_Calendar_limit (date,did) { if (debug && debug > 5) { var month = date.getMonth() + 1; var dateString = date.getFullYear() + '-' + month + '-' + date.getDate(); - alert("Comparing incoming (" + dateString + ") vs " + alert(_('Comparing incoming ')+'(' + dateString + ') vs ' + "'" + did + "' limit\n" + "\n thisdate: " + date + "\nlimitdate: " + limitDate diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/labels-batches-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/labels-batches-toolbar.inc index 47a0b8f..4a0d4ab 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/labels-batches-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/labels-batches-toolbar.inc @@ -2,7 +2,7 @@ diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tmpl index 331ec2c..d9847dd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tmpl @@ -11,14 +11,14 @@ function checkForm(form) { if((form.checkbox[0].checked)){ if(!(form.date1.value)){ - alert("please enter a date !"); + alert(_("please enter a date !")); document.form.date1.focus(); return false; } } if((form.checkbox[1].checked)){ if(!(form.date2.value)){ - alert("please enter a date !"); + alert(_("please enter a date !")); document.form.date2.focus(); return false; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tmpl index 4e43c72..4863f9d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tmpl @@ -14,7 +14,7 @@ $(document).ready(function(){ }); function CheckForm(f) { if ($("#fileToUpload").value == '') { - alert('Please upload a file first.'); + alert(_('Please upload a file first.')); } else { return submitBackgroundJob(f); } diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/opac-tmpl/prog/en/includes/calendar.inc index c36daa6..4b0fce6 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/calendar.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/calendar.inc @@ -32,7 +32,7 @@ function get_Calendar_limit (date,did) { if (debug && debug > 5) { var month = date.getMonth() + 1; var dateString = date.getFullYear() + '-' + month + '-' + date.getDate(); - alert("Comparing incoming (" + dateString + ") vs " + alert(_("Comparing incoming (") + dateString + ") vs " + "'" + did + "' limit\n" + "\n thisdate: " + date + "\nlimitdate: " + limitDate diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results-grouped.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results-grouped.tmpl index cb8ecd3..8092478 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results-grouped.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results-grouped.tmpl @@ -34,12 +34,12 @@ $(document).ready(function(){ var shelfnumber = $("#addto").find("option:selected").attr("id").replace("s",""); if (vShelfAdd()) { Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?selectedshelf='+shelfnumber+'&' + vShelfAdd()); - } alert('You must be logged in to create or add to Lists'); + } alert(_('You must be logged in to create or add to Lists')); return false; } else if($("#addto").find("option:selected").attr("value") == "newlist"){ if (vShelfAdd()) { Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?newshelf=1&' + vShelfAdd()); - } alert('You must be logged in to create or add to Lists'); + } alert(_('You must be logged in to create or add to Lists')); return false; } if($("#addto").find("option:selected").attr("value") == "addtocart"){ diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl index 5485237..653733a 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl @@ -164,12 +164,12 @@ $(document).ready(function(){ } else if($("#addto").find("option:selected").attr("value") == "newlist"){ if (vShelfAdd()) { Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?newshelf=1&' + vShelfAdd()); - } alert('You must be logged in to create or add to Lists'); + } alert(_('You must be logged in to create or add to Lists')); return false; } else if($("#addto").find("option:selected").attr("value") == "morelists"){ if (vShelfAdd()) { Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?' + vShelfAdd()); - } alert('You must be logged in to create or add to Lists'); + } alert(_('You must be logged in to create or add to Lists')); return false; } if($("#addto").find("option:selected").attr("value") == "addtocart" || $("#addto").attr("class") == "addtocart"){ diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-review.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-review.tmpl index 573295e..f43d8e4 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-review.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-review.tmpl @@ -8,7 +8,7 @@ $(document).ready(function() { var inject_old = function(comment) { - alert("injecting OLD comment: " +comment); + alert(_("injecting OLD comment: ") +comment); parent.opener.$('#c p').prev("small").prev("h5").html("Your Edited Comment (preview, pending approval)"); parent.opener.$('#c p').html(comment); parent.opener.$('#c p').append(" &reviewid=\');\">Edit<\/a>"); @@ -16,7 +16,7 @@ return 1; }; var inject_new = function(comment) { - alert("injecting NEW comment: " +comment); + alert(_("injecting NEW comment: ") +comment); parent.opener.$('#newcomment').attr("class","yours"); parent.opener.$('#newcomment').html( "
Your Comment (preview, pending approval)<\/h5>" + -- 1.7.1