var MSG_BASKET_EMPTY = _("Your cart is currently empty");
var MSG_RECORD_IN_BASKET = _("This item is already in your cart");
var MSG_RECORD_ADDED = _("This item has been added to your cart");
- var MSG_NRECORDS_ADDED = _(" item(s) added to your cart");
- var MSG_NRECORDS_IN_BASKET = _("already in your cart");
+ var MSG_NRECORDS_ADDED = _("%s item(s) added to your cart");
+ var MSG_NRECORDS_IN_BASKET = _("%s already in your cart");
var MSG_NO_RECORD_SELECTED = _("No item was selected");
- var MSG_NO_RECORD_ADDED = _("No item was added to your cart");
+ var MSG_NO_RECORD_ADDED = _("No item was added to your cart (already in your cart) !");
var MSG_CONFIRM_DEL_BASKET = _("Are you sure you want to empty your cart?");
var MSG_CONFIRM_DEL_RECORDS = _("Are you sure you want to remove the selected items?");
- var MSG_IN_YOUR_CART = _("Items in your cart: ");
+ var MSG_IN_YOUR_CART = _("Items in your cart: %s");
var MSG_NON_RESERVES_SELECTED = _("One or more selected items cannot be reserved.");
//]]>
</script>
[%# transletable strings for merge-record.js %]
<script type="text/javascript">
var MSG_MERGEREC_ALREADY_EXISTS = _("The field is non-repeatable and already exists in the destination record. Therefore, you cannot add it.");
- var MSG_MERGEREC_SUBFIELD_PRE = _("This subfield cannot be added: there is no");
- var MSG_MERGEREC_SUBFIELD_POST = _("field in the destination record.");
+ var MSG_MERGEREC_SUBFIELD = _("This subfield cannot be added: there is no %s field in the destination record.");
</script>
\ No newline at end of file
var msg = "";
if (nbAdd) {
if (i > nbAdd) {
- msg = nbAdd+" "+MSG_NRECORDS_ADDED+", "+(i-nbAdd)+" "+MSG_NRECORDS_IN_BASKET;
+ msg = MSG_NRECORDS_ADDED.format(nbAdd);
+ msg += MSG_NRECORDS_IN_BASKET.format((i-nbAdd));
}
else {
- msg = nbAdd+" "+MSG_NRECORDS_ADDED;
+ msg = MSG_NRECORDS_ADDED.format(nbAdd);
}
}
else {
msg = MSG_NO_RECORD_SELECTED;
}
else {
- msg = MSG_NO_RECORD_ADDED+" ("+MSG_NRECORDS_IN_BASKET+") !";
+ msg = MSG_NO_RECORD_ADDED;
}
}
showCartUpdate(msg);
function updateBasket(updated_value,target) {
if(target){
target.$('#basketcount').html(" <span>("+updated_value+")</span>");
- target.$('#cartDetails').html(MSG_IN_YOUR_CART+updated_value);
+ target.$('#cartDetails').html(MSG_IN_YOUR_CART.format(updated_value));
} else {
$('#basketcount').html(" <span>("+updated_value+")</span>");
- $('#cartDetails').html(MSG_IN_YOUR_CART+updated_value);
+ $('#cartDetails').html(MSG_IN_YOUR_CART.format(updated_value));
}
var basketcount = updated_value;
}
replace_html_date( original_node, id, format );
break;
default:
- alert("_(This node can't be replaced)");
+ alert(_("This node can't be replaced"));
}
}
// Replace a node with a "From [date] To [date]" element
// Used on tfoot > td
function replace_html_date( original_node, id, format ) {
- var node = $('<span style="white-space:nowrap">' + _("From") + '<input type="text" id="' + id + 'from" readonly="readonly" placeholder=\'' + _("Pick date") + '\' size="7" /><a title="Delete this filter" style="cursor:pointer" onclick=\'$("#' + id + 'from").val("").change();\' >×</a></span><br/><span style="white-space:nowrap">' + _("To") + '<input type="text" id="' + id + 'to" readonly="readonly" placeholder=\'' + _("Pick date") + '\' size="7" /><a title="Delete this filter" style="cursor:pointer" onclick=\'$("#' + id + 'to").val("").change();\' >×</a></span>');
+ var node = $('<span style="white-space:nowrap">' + _("From") + '<input type="text" id="' + id + 'from" readonly="readonly" placeholder=\'' + _("Pick date") + '\' size="7" /><a title="' + _("Delete this filter") + '" style="cursor:pointer" onclick=\'$("#' + id + 'from").val("").change();\' >×</a></span><br/><span style="white-space:nowrap">' + _("To") + '<input type="text" id="' + id + 'to" readonly="readonly" placeholder=\'' + _("Pick date") + '\' size="7" /><a title="' + _("Delete this filter") + '" style="cursor:pointer" onclick=\'$("#' + id + 'to").val("").change();\' >×</a></span>');
$(original_node).replaceWith(node);
var script = document.createElement( 'script' );
script.type = 'text/javascript';
var ok=1;
var msg;
if ( (date.length < 2) && (ok==1) ) {
- msg = MSG_SEPARATOR+field.name;
+ msg = MSG_SEPARATOR.format(field.name);
alert(msg); ok=0; field.focus();
return;
}
var yyyy = date[2];
// checking days
if ( ((isNaN(dd))||(dd<1)||(dd>31)) && (ok==1) ) {
- msg = MSG_INCORRECT_DAY+field.name;
+ msg = MSG_INCORRECT_DAY.format(field.name);
alert(msg); ok=0; field.focus();
return false;
}
// checking months
if ( ((isNaN(mm))||(mm<1)||(mm>12)) && (ok==1) ) {
- msg = MSG_INCORRECT_MONTH+field.name;
+ msg = MSG_INCORRECT_MONTH.format(field.name);
alert(msg); ok=0; field.focus();
return false;
}
// checking years
if ( ((isNaN(yyyy))||(yyyy<amin)||(yyyy>amax)) && (ok==1) ) {
- msg = MSG_INCORRECT_YEAR+field.name;
+ msg = MSG_INCORRECT_YEAR.format(field.name);
alert(msg); ok=0; field.focus();
return false;
}
// We select the whole field and removing non-selected subfields, instead of...
// Alerting the user
- alert(MSG_MERGEREC_SUBFIELD_PRE + " " + field + " " + MSG_MERGEREC_SUBFIELD_POST);
+ alert(MSG_MERGEREC_SUBFIELD.format(field));
pField.checked = false;
} else {
$(where).nextAll("ul").append(clone);
humanMsg.displayAlert( MSG_NOTHING_TO_SAVE );
return;
}
- KOHA.AJAX.MarkRunning( $( form ).find( '.save-all' ), _( MSG_SAVING ) );
+ KOHA.AJAX.MarkRunning( $( form ).find( '.save-all' ), MSG_SAVING );
KOHA.AJAX.Submit( {
data: data,
url: '/cgi-bin/koha/svc/config/systempreferences/',
modified_prefs.each(function(){
var modified_pref = $(this).attr("id");
modified_pref = modified_pref.replace("pref_","");
- msg += "<strong>"+ MSG_SAVED_PREFERENCE + " " + modified_pref + "</strong>\n";
+ msg += "<strong>"+ MSG_SAVED_PREFERENCE.format(modified_pref) + "</strong>\n";
});
humanMsg.displayAlert(msg);
}).responseXML;
if (this.xmlDoc) this.renderTemplate();
$("*").ajaxError(function(evt, request, settings){
- alert(_("AJAX error: receiving data from ") + settings.url);
+ alert(_("AJAX error: receiving data from %s").format(settings.url));
});
},//loadXmlValues
var search_jumped = [% IF ( search_jumped ) %]true[% ELSE %]false[% END %];
var MSG_NOTHING_TO_SAVE = _("Nothing to save");
var MSG_SAVING = _("Saving...");
- var MSG_SAVED_PREFERENCE = _("Saved preference");
+ var MSG_SAVED_PREFERENCE = _("Saved preference %s");
var MSG_MODIFIED = _("modified");
var MSG_MADE_CHANGES = _("You have made changes to system preferences.");
var MSG_CLICK_TO_EXPAND = _("Click to expand this section");
<script type="text/javascript">
//<![CDATA[
var ALERT_SUCCESSFUL_CHECKIN = _("Checked in item.");
-var ALERT_MATERIALS = _("Note about the accompanying materials: ");
+var ALERT_MATERIALS = _("Note about the accompanying materials: %s");
var ALERT_RESTRICTED = _("Patron is RESTRICTED");
-var ALERT_NO_MATCHING_ITEM = _("No item with barcode in offline database (transaction recorded anyway): ");
+var ALERT_NO_MATCHING_ITEM = _("No item with barcode in offline database (transaction recorded anyway): %s");
var ALERT_NOT_CHECKED_OUT = _("Item not listed as checked out in offline database (transaction recorded anyway)");
var ALERT_ITEM_WITHDRAWN = _("Item has been withdrawn (transaction recorded anyway)");
var ALERT_ITEM_RESTRICTED = _("Item is restricted (transaction recorded anyway)");
var ALERT_ITEM_LOST = _("Item has been lost (transaction recorded anyway)");
-var ALERT_NO_MATCHING_PATRON = _("No patron cardnumber in offline database (proceeding anyway): ");
+var ALERT_NO_MATCHING_PATRON = _("No patron cardnumber in offline database (proceeding anyway): %s");
var ALERT_PATRON_GONE_NO_ADDRESS = _("Patron's address is in doubt (proceeding anyway)");
var ALERT_PATRON_CARD_LOST = _("Patron's card is lost");
-var ALERT_PATRON_EXPIRED = _("Patron's card is expired");
-var ALERT_PATRON_BLOCKED_TEMPORARY = _("Patron has had overdue items and is restricted until: ");
+var ALERT_PATRON_EXPIRED = _("Patron's card is expired (%s)");
+var ALERT_PATRON_BLOCKED_TEMPORARY = _("Patron has had overdue items and is restricted until: %s");
var ALERT_PATRON_RESTRICTED = _("Patron is restricted");
-var ALERT_PATRON_FINE = _("Patron has outstanding fines: ");
-var ALERT_PATRON_FINE_OVER_LIMIT = _("Patron fines are over limit: ");
+var ALERT_PATRON_FINE = _("Patron has outstanding fines: %s");
+var ALERT_PATRON_FINE_OVER_LIMIT = _("Patron fines are over limit: %s");
var UPLOAD_PENDING_MESSAGE = _("You have transactions in the offline circulation database on this computer that have not been uploaded.");
var NO_UPLOAD_PENDING_MESSAGE = _("You do not have any pending transactions in the offline circulation database on this computer.");
function checkAlerts(barcode, item) {
var alerts = [];
if (typeof item === 'undefined') {
- alerts.push(ALERT_NO_MATCHING_ITEM + barcode);
+ alerts.push(ALERT_NO_MATCHING_ITEM.format(barcode));
} else {
if (typeof item.materials !== 'undefined' && item.materials != null) {
- alerts.push(ALERT_MATERIALS + item.materials);
+ alerts.push(ALERT_MATERIALS.format(item.materials));
}
}
return alerts;
function checkPatronAlerts(cardnumber, patron) {
var alerts = [];
if (typeof patron === 'undefined') {
- alerts.push(ALERT_NO_MATCHING_PATRON + cardnumber);
+ alerts.push(ALERT_NO_MATCHING_PATRON.format(cardnumber));
} else {
if (patron.gonenoaddress !== '0') {
alerts.push(ALERT_PATRON_GONE_NO_ADDRESS);
}
if (patron.debarred !== null) {
if (patron.debarred != '9999-12-31') {
- alerts.push(ALERT_PATRON_BLOCKED_TEMPORARY + $.datepicker.formatDate(dateformat, new Date(patron.debarred)));
+ alerts.push(ALERT_PATRON_BLOCKED_TEMPORARY.format($.datepicker.formatDate(dateformat, new Date(patron.debarred))));
} else {
alerts.push(ALERT_PATRON_RESTRICTED);
}
}
if (new Date(patron.dateexpiry) < new Date()) {
- alerts.push(ALERT_PATRON_EXPIRED + ' (' + $.datepicker.formatDate(dateformat, new Date(patron.dateexpiry)) + ')');
+ alerts.push(ALERT_PATRON_EXPIRED.format($.datepicker.formatDate(dateformat, new Date(patron.dateexpiry))));
}
if (parseInt(patron.fine) > [% maxoutstanding %]) {
- alerts.push(ALERT_PATRON_FINE_OVER_LIMIT + patron.fine);
+ alerts.push(ALERT_PATRON_FINE_OVER_LIMIT.format(patron.fine));
} else if (parseInt(patron.fine) > 0) {
- alerts.push(ALERT_PATRON_FINE + patron.fine);
+ alerts.push(ALERT_PATRON_FINE.format(patron.fine));
}
}
return alerts;
$(mytables).find(" li[data-category_code='']").show();
}
- var MSG_SEPARATOR = _("Separator must be / in field ");
- var MSG_INCORRECT_DAY = _("Invalid day entered in field ");
- var MSG_INCORRECT_MONTH = _("Invalid month entered in field ");
- var MSG_INCORRECT_YEAR = _("Invalid year entered in field ");
+ var MSG_SEPARATOR = _("Separator must be / in field %s");
+ var MSG_INCORRECT_DAY = _("Invalid day entered in field %s");
+ var MSG_INCORRECT_MONTH = _("Invalid month entered in field %s");
+ var MSG_INCORRECT_YEAR = _("Invalid year entered in field %s");
var MSG_DUPLICATE_PATRON = _("Warning: Duplicate patron");
var MSG_DUPLICATE_ORGANIZATION = _("Warning: Duplicate organization");
var MSG_LATE_EXPIRY = _("Warning: Expiration date falls before enrollment date");
document.getElementById('description').value = description;
window.modaction_legend_innerhtml = document.getElementById('modaction_legend').innerhtml;
- document.getElementById('modaction_legend').innerhtml = _("Edit action") + ordering;
+ document.getElementById('modaction_legend').innerhtml = _("Edit action%s").format(ordering);
window.action_submit_value = document.getElementById('action_submit').value;
document.getElementById('action_submit').value = _("Update action");