@@ -, +, @@
---
.../intranet-tmpl/prog/en/includes/cat-toolbar.inc | 16 ++++++++--------
koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js | 13 +++++++++++++
.../prog/en/modules/acqui/addorderiso2709.tt | 2 +-
.../prog/en/modules/acqui/aqbasketuser_search.tt | 2 +-
.../intranet-tmpl/prog/en/modules/acqui/booksellers.tt | 2 +-
.../intranet-tmpl/prog/en/modules/acqui/invoices.tt | 2 +-
.../prog/en/modules/acqui/neworderempty.tt | 5 ++---
.../prog/en/modules/acqui/orderreceive.tt | 2 +-
.../prog/en/modules/acqui/z3950_search.tt | 2 +-
.../prog/en/modules/admin/biblio_framework.tt | 4 ++--
.../prog/en/modules/admin/item_circulation_alerts.tt | 2 +-
.../prog/en/modules/authorities/authorities.tt | 4 ++--
.../prog/en/modules/cataloguing/addbiblio.tt | 4 ++--
.../prog/en/modules/cataloguing/additem.tt | 2 +-
.../cataloguing/value_builder/marc21_field_006.tt | 2 +-
.../cataloguing/value_builder/marc21_field_008.tt | 2 +-
.../prog/en/modules/cataloguing/z3950_auth_search.tt | 2 +-
.../prog/en/modules/cataloguing/z3950_search.tt | 2 +-
.../intranet-tmpl/prog/en/modules/circ/offline.tt | 10 +++++-----
.../prog/en/modules/labels/label-manage.tt | 6 +++---
koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt | 3 +--
.../prog/en/modules/patron_lists/lists.tt | 2 +-
.../prog/en/modules/patroncards/edit-batch.tt | 4 ++--
.../prog/en/modules/patroncards/image-manage.tt | 4 ++--
.../prog/en/modules/patroncards/manage.tt | 6 +++---
.../intranet-tmpl/prog/en/modules/reserve/request.tt | 2 +-
.../prog/en/modules/serials/serials-edit.tt | 2 +-
.../prog/en/modules/serials/subscription-add.tt | 6 ++----
koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt | 12 ++++++------
.../intranet-tmpl/prog/en/modules/tools/holidays.tt | 8 ++++----
.../prog/en/modules/tools/manage-marc-import.tt | 18 ++++++++----------
.../prog/en/modules/tools/modborrowers.tt | 2 +-
.../prog/en/modules/tools/quotes-upload.tt | 10 +++++-----
.../intranet-tmpl/prog/en/modules/tools/quotes.tt | 2 +-
34 files changed, 87 insertions(+), 80 deletions(-)
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc
+++ a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc
@@ -35,24 +35,24 @@
var countdeletedorders = [% countdeletedorders %];
var is_confirmed;
if (count > 0){
- is_confirmed = alert( count + " " +_("item(s) are attached to this record. You must delete all items before deleting this record.") );
+ is_confirmed = alert( _("%s item(s) are attached to this record. You must delete all items before deleting this record.").format(count) );
}
else if (countorders > 0){
[% IF ( CAN_user_acquisition_order_manage ) %]
- is_confirmed = confirm( _("Warning: This record is used in")+" "+ countorders + " " +_("order(s). Deleting it could cause serious issues on acquisition module. Are you sure you want to delete this record?") );
+ is_confirmed = confirm( _("Warning: This record is used in %s order(s). Deleting it could cause serious issues on acquisition module. Are you sure you want to delete this record?").format(countorders) );
[% ELSE %]
- is_confirmed = alert( countorders + " " +_("order(s) are using this record. You need order managing permissions to delete this record.") );
+ is_confirmed = alert( _("%s order(s) are using this record. You need order managing permissions to delete this record.").format(countorders) );
[% END %]
}
else if (countdeletedorders > 0){
[% IF ( CAN_user_acquisition_order_manage ) %]
- is_confirmed = confirm( countdeletedorders + " " +_("deleted order(s) are using this record. Are you sure you want to delete this record?") );
+ is_confirmed = confirm( _("%s deleted order(s) are using this record. Are you sure you want to delete this record?").format(countdeletedorders) );
[% ELSE %]
- is_confirmed = alert( countdeletedorders + " " +_("deleted order(s) are using this record. You need order managing permissions to delete this record.") );
+ is_confirmed = alert( _("%s deleted order(s) are using this record. You need order managing permissions to delete this record.").format(countdeletedorders) );
[% END %]
}
else if ( holdcount > 0 ) {
- is_confirmed = confirm( holdcount + " " + _("holds(s) for this record. Are you sure you want to delete this record?"));
+ is_confirmed = confirm( _("%s holds(s) for this record. Are you sure you want to delete this record?").format(holdcount) );
} else {
is_confirmed = confirm(_("Are you sure you want to delete this record?"));
}
@@ -74,9 +74,9 @@
var holdcount = [% holdcount %];
if ( holdcount > 0 ) {
- alert( holdcount + " " + _("hold(s) on this record. You must delete all holds before deleting all items.") );
+ alert( _("%s hold(s) on this record. You must delete all holds before deleting all items.").format(holdcount) );
} else if ( count > 0 ) {
- if( confirm( _("Are you sure you want to delete the") + " " + count + " " + _("attached items?") ) ) {
+ if( confirm( _("Are you sure you want to delete the %s attached items?").format(count) ) ) {
window.location="/cgi-bin/koha/cataloguing/additem.pl?op=delallitems&biblionumber=[% biblionumber %]";
} else {
return false;
--- a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js
+++ a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js
@@ -3,6 +3,19 @@ if ( KOHA === undefined ) var KOHA = {};
function _(s) { return s; } // dummy function for gettext
+// http://stackoverflow.com/questions/1038746/equivalent-of-string-format-in-jquery/5341855#5341855
+String.prototype.format = function() { return formatstr(this, arguments) }
+function formatstr(str, col) {
+ col = typeof col === 'object' ? col : Array.prototype.slice.call(arguments, 1);
+ var idx = 0;
+ return str.replace(/%%|%s|%(\d+)\$s/g, function (m, n) {
+ if (m == "%%") { return "%"; }
+ if (m == "%s") { return col[idx++]; }
+ return col[n];
+ });
+};
+
+
// http://stackoverflow.com/questions/14859281/select-tab-by-name-in-jquery-ui-1-10-0/16550804#16550804
$.fn.tabIndex = function () {
return $(this).parent().find(this).index() - 1;
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt
@@ -34,7 +34,7 @@
if (total_errors > 0) {
var alertString = _("Form not submitted because of the following problem(s)");
alertString += "\n------------------------------------------------------------------------------------\n";
- alertString += "\n- "+ total_errors + _(" mandatory fields empty (highlighted)");
+ alertString += "\n- " + _("%s mandatory fields empty (highlighted)").format(total_errors);
alert(alertString);
return false;
}
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/aqbasketuser_search.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/aqbasketuser_search.tt
@@ -18,7 +18,7 @@
function add_user(borrowernumber, borrowername) {
var p = window.opener;
if(p.add_basket_user(borrowernumber, borrowername) < 0) {
- alert(_("Borrower '" + borrowername + "' is already in the list."));
+ alert(_("Borrower '%s' is already in the list.").format(borrowername));
}
}
//]]>
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt
@@ -31,7 +31,7 @@ $(document).ready(function() {
});
$(".modal").on("show", function(){
var basket = $(this).data("basketno");
- var legend = _("Add order to basket") + " " + basket;
+ var legend = _("Add order to basket %s").format(basket);
$(this).find("legend").html(legend);
});
});
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt
@@ -70,7 +70,7 @@ $(document).ready(function() {
$('#merge_' + prop).val(invoice[prop]);
});
if (invoice.closedate) {
- $('#merge_status').text(_("Closed on " + invoice.closedate + ""));
+ $('#merge_status').text(_("Closed on %s").format(invoice.closedate));
} else {
$('#merge_status').text(_("Open"));
}
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt
@@ -60,8 +60,7 @@ function Check(ff) {
if (totalExceedsBudget(ff.budget_id.value, ff.total.value ) ) {
ok=1;
- _alertString += "\n- " + _("Order total (") + ff.total.value +
- _(") exceeds budget available (") + actTotal+")";
+ _alertString += "\n- " + _("Order total (%s) exceeds budget available (%s)").format(ff.total.value, actTotal);
}
if ( ff.field_value ) {
@@ -69,7 +68,7 @@ function Check(ff) {
if (empty_item_mandatory > 0) {
ok = 1;
_alertString +=
- "\n- " + empty_item_mandatory + _(" item mandatory fields empty");
+ "\n- " + _("%s item mandatory fields empty").format(empty_item_mandatory);
}
}
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt
@@ -13,7 +13,7 @@
if (total_errors != 0) {
var alertString = _("Form not submitted because of the following problem(s)");
alertString += "\n------------------------------------------------------------------------------------\n";
- alertString += "\n- "+ total_errors+_(" mandatory fields empty (highlighted)");
+ alertString += "\n- " + _("%s mandatory fields empty (highlighted)").format(total_errors);
alert(alertString);
return false;
}
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt
@@ -59,7 +59,7 @@ function validate_goto_page(){
return false;
}
else if(page < 1 || page > [% total_pages %] ) {
- alert(_("The page should be a number between 1 and ") + [% total_pages %] + ".");
+ alert(_("The page should be a number between 1 and %s.").format([% total_pages %]));
return false;
}
else {
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt
@@ -67,7 +67,7 @@ function Check(f) {
var matches = new RegExp("\\?error_import_export=(.+)$").exec(window.location.search);
if (matches && matches.length > 1) {
- alert(_("Error importing the framework ") + decodeURIComponent(matches[1]));
+ alert(_("Error importing the framework %s").format(decodeURIComponent(matches[1])));
}
$('input.input_import').change( function() {
@@ -89,7 +89,7 @@ function Check(f) {
if (/(?:\.csv|\.ods|\.xml)$/.test(obj.val())) {
if (confirm(_("Do you really want to import the framework fields and subfields? This will overwrite the current configuration. For safety reasons please use the export option to make a backup"))) {
var frameworkcode = $('#' + id + ' input:hidden[name=frameworkcode]').val();
- $('#importing_' + frameworkcode).find("span").html(_("Importing to framework:")+"" + frameworkcode + ". " +_("Importing from file:")+"" + obj.val().replace(new RegExp("^.+[/\\\\]"),"") + "");
+ $('#importing_' + frameworkcode).find("span").html(_("Importing to framework: %s. Importing from file: %s").format("" + frameworkcode + "", "" + obj.val().replace(new RegExp("^.+[/\\\\]"),"") + ""));
if (navigator.userAgent.toLowerCase().indexOf('msie') != -1) {
var timestamp = new Date().getTime();
$('#importing_' + frameworkcode).find("img").attr('src', '[% interface %]/[% theme %]/img/loading-small.gif' + '?' +timestamp);
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/item_circulation_alerts.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/item_circulation_alerts.tt
@@ -45,7 +45,7 @@ $(function(){
var blocked = _("Blocked!");
var saving = _("Saving...");
var disabledForAll = _("Disabled for all");
- var disabledForCurrent = _("Disabled for") + ' ' + $branch;
+ var disabledForCurrent = _("Disabled for %s").format($branch);
$('#branch_selector input:submit').hide();
$('#branch').change(function(){
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt
@@ -46,7 +46,7 @@ function AreMandatoriesNotOk(){
// alert (id_string);
if( ! $("#" + id_string).val() ){
$("#" + id_string).attr('class','subfield_not_filled').focus();
- StrAlert += "\t* "+label[i]+_(" in tab ")+tab[i]+"\n";
+ StrAlert += "\t* " + _("%s in tab %s").format(label[i], tab[i]) + "\n";
}
}
@@ -79,7 +79,7 @@ function AreMandatoriesNotOk(){
if(isempty){
flag = 1;
- StrAlert += "\t* Field " + arr[0] + _(" is mandatory, at least one of its subfields must be filled") + "\n";
+ StrAlert += "\t* " + _("Field %s is mandatory, at least one of its subfields must be filled.").format(arr[0]) + "\n";
}
}
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt
@@ -258,7 +258,7 @@ function AreMandatoriesNotOk(){
if (tabflag[tagsubfieldid][0]==0){
var tag=tagsubfieldid.substr(0,3);
var subfield=tagsubfieldid.substr(3,1);
- StrAlert += "\t* "+_("tag ")+tag+_(" subfield ")+subfield+" "+tabflag[tagsubfieldid][1]+_(" in tab ")+tabflag[tagsubfieldid][2]+"\n";
+ StrAlert += "\t* "+_("tag %s subfield %s %s in tab %s").format(tag, subfield, tabflag[tagsubfieldid][1], tabflag[tagsubfieldid][2]) + "\n";
//StrAlert += "\t* "+label[i]+_(" in tab ")+tab[i]+"\n";
flag=1;
}
@@ -308,7 +308,7 @@ function AreMandatoriesNotOk(){
if(isempty){
flag = 1;
- StrAlert += _("\t* Field ") + arr[0] + _(" is mandatory, at least one of its subfields must be filled.") + "\n";
+ StrAlert += "\t* " + _("Field %s is mandatory, at least one of its subfields must be filled.").format(arr[0]) + "\n";
}
}
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt
@@ -64,7 +64,7 @@ function Check(f) {
if (total_errors > 0) {
var alertString2 = _("Form not submitted because of the following problem(s)");
alertString2 += "\n------------------------------------------------------------------------------------\n";
- alertString2 += "\n- "+ total_errors + _(" mandatory fields empty (highlighted)");
+ alertString2 += "\n- " + _("%s mandatory fields empty (highlighted)").format(total_errors);
alert(alertString2);
return false;
}
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.tt
@@ -24,7 +24,7 @@
function changeTypeofMaterial(form)
{
- if (form.material_type.options[form.material_type.selectedIndex].value != "" && confirm(_("Show values for") +' \'' + form.material_type.options[form.material_type.selectedIndex].text + '\' ' +_("material type?"))) {
+ if (form.material_type.options[form.material_type.selectedIndex].value != "" && confirm(_("Show values for '%s' material type?").format(form.material_type.options[form.material_type.selectedIndex].text))) {
objXmlControlField.setIdMaterial(form.material_type.options[form.material_type.selectedIndex].value);
objXmlControlField.renderTemplate();
renderResult(tr_result, form.result.value, true);
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tt
@@ -24,7 +24,7 @@
function changeTypeofMaterial(form)
{
- if (form.material_type.options[form.material_type.selectedIndex].value != "" && confirm(_("Show values for") + ' \'' + form.material_type.options[form.material_type.selectedIndex].text + '\' ' + _("material type?"))) {
+ if (form.material_type.options[form.material_type.selectedIndex].value != "" && confirm(_("Show values for '%s' material type?").format(form.material_type.options[form.material_type.selectedIndex].text))) {
objXmlControlField.setIdMaterial(form.material_type.options[form.material_type.selectedIndex].value);
objXmlControlField.renderTemplate();
renderResult(tr_result, form.result.value, true);
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt
@@ -68,7 +68,7 @@ function validate_goto_page(){
return false;
}
else if(page < 1 || page > [% total_pages %] ) {
- alert(_("The page should be a number between 1 and ") + [% total_pages %] + ".");
+ alert(_("The page should be a number between 1 and %s.").format([% total_pages %]));
return false;
}
else {
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt
@@ -69,7 +69,7 @@ function validate_goto_page(){
return false;
}
else if(page < 1 || page > [% total_pages %] ) {
- alert(_("The page should be a number between 1 and ") + [% total_pages %] + ".");
+ alert(_("The page should be a number between 1 and %s.").format([% total_pages %]));
return false;
}
else {
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt
@@ -119,7 +119,7 @@ function synchronize() {
}).done(function (data) {
if (data) {
$('.loading-overlay').hide();
- alert(_("Please log in to Koha and try again. (Error: '" + data + "')"));
+ alert(_("Please log in to Koha and try again. (Error: '%s')").format(data));
} else {
var uploadIter = $.indexedDB("koha").objectStore("transactions").each(uploadTransaction);
uploadIter.done(function() {
@@ -193,7 +193,7 @@ function finishedLoading() {
function loadRecords(page) {
[% IF (AllowOfflineCirculation) %]
- $(".loading-overlay div").text(_("Loading page " + page + ", please wait..."));
+ $(".loading-overlay div").text(_("Loading page %s, please wait...").format(page));
$(".loading-overlay").show();
$.ajax({
type: "GET",
@@ -378,7 +378,7 @@ function showPatron(barcode, patron, error) {
if (patron.name.length > 0) {
$('.patron-title').text(patron.name);
} else {
- $('.patron-title').text(_("Unrecognized patron") + " (" + barcode + ")");
+ $('.patron-title').text(_("Unrecognized patron (%s)").format(barcode));
}
if (patron.address.length > 0 || patron.address2.length > 0) {
$('#patron-address-1').text(patron.address);
@@ -403,12 +403,12 @@ function showPatron(barcode, patron, error) {
$('#patron-email').html('' + _("No email stored.") + '');
}
if (patron.categorycode.length > 0) {
- $('#patron-category').text(_("Category: ") + patron.categorycode);
+ $('#patron-category').text(_("Category: %s").format(patron.categorycode));
} else {
$('#patron-category').html('' + _("Category code unknown.") + '');
}
if (patron.branchcode.length > 0) {
- $('#patron-library').text(_("Home library: ") + patron.branchcode);
+ $('#patron-library').text(_("Home library: %s").format(patron.branchcode));
} else {
$('#patron-library').html('' + _("Home library unknown.") + '');
}
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt
@@ -7,7 +7,7 @@
function DeleteConfirm() {
var element_id = selected_layout("delete");
if (element_id>-1) {
- var msg = "Are you sure you want to delete [% label_element %] " + element_id + "?"
+ var msg = _("Are you sure you want to delete %s %s?").format("[% label_element %]", element_id);
var answer = confirm(msg);
if (answer) {
window.location = "/cgi-bin/koha/labels/label-manage.pl?op=delete&label_element=[% label_element %]&element_id=" + element_id;
@@ -64,7 +64,7 @@
return(document.layouts.action[selected[0]].value);
}
else {
- alert(_("Please select only one ")+"[% label_element %]"+_(" to")+op+".");
+ alert(_("Please select only one %s to %s.").format("[% label_element %]", op));
return (-1);
}
}
@@ -73,7 +73,7 @@
return(document.layouts.action.value);
}
};
- alert(_("Please select a ")+"[% label_element %].");
+ alert(_("Please select a %s.").format("[% label_element %]"));
return (-1);
};
//]]>
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt
@@ -16,8 +16,7 @@ function enableCheckboxActions(){
$(document).ready(function(){
$('#pay-fines-form').preventDoubleFormSubmit();
$("#woall").click(function(event){
- var msg = _("Are you sure you want to write off %s in outstanding fines? This cannot be undone!");
- msg = msg.replace( "%s", "[% total | format('%.2f') %]" );
+ var msg = _("Are you sure you want to write off %s in outstanding fines? This cannot be undone!").format( "[% total | format('%.2f') %]" );
var answer = confirm(msg);
if (!answer){
event.preventDefault();
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/lists.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/lists.tt
@@ -16,7 +16,7 @@
});
function ConfirmDelete( list ) {
- return confirm( _("Are you sure you want to delete the list ") + list + "?" );
+ return confirm( _("Are you sure you want to delete the list %s?").format(list) );
}
//]]>
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt
@@ -7,7 +7,7 @@