From 1523ff2223a23dc843a62f9d3f2e0df7a1d6dbfe Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 7 May 2014 10:54:14 -0400 Subject: [PATCH] Bug 11703 [QA Followup] - Use format instead of replace for string translation Signed-off-by: Jonathan Druart --- koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc | 10 +++++----- koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js | 2 +- koha-tmpl/intranet-tmpl/prog/en/js/holds.js | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc index 3755dd1..536a055 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc @@ -14,14 +14,14 @@ var ON_HOLD = _("On hold"); var NOT_RENEWABLE = _("Not renewable"); var NOT_RENEWABLE_TOO_SOON = _("Cannot renew, renewal is premature"); - var RENEWALS_REMAINING = _("_RENEWALS_REMAINING_ of _RENEWALS_ALLOWED_ renewals remaining"); + var RENEWALS_REMAINING = _("%s of %s renewals remaining"); var HOLD_IS_SUSPENDED = _("Hold is suspended"); - var UNTIL = _("until _SUSPEND_UNTIL_"); + var UNTIL = _("until %s"); var ITEM_IS_WAITING = _("Item is waiting"); // - var AT = _("at _WAITING_AT_BRANCH_"); - var ITEM_IS_IN_TRANSIT = _("Item is in transit from _FROM_BRANCH_"); + var AT = _("at %s"); + var ITEM_IS_IN_TRANSIT = _("Item is in transit from %s"); var FROM = _("from"); - var NOT_TRANSFERRED_YET = _("Item hasn't been transferred yet from _FROM_BRANCH_"); + var NOT_TRANSFERRED_YET = _("Item hasn't been transferred yet from %s"); var NO = _("No"); var YES = _("Yes"); //]]> diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js index eca940a..4ab7be1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js @@ -258,7 +258,7 @@ $(document).ready(function() { if ( oObj.renewals_remaining ) { content += "(" - + RENEWALS_REMAINING.replace( "_RENEWALS_REMAINING_", oObj.renewals_remaining ).replace( "_RENEWALS_ALLOWED_", oObj.renewals_allowed ) + + RENEWALS_REMAINING.format( oObj.renewals_remaining, oObj.renewals_allowed ) + ")"; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/holds.js b/koha-tmpl/intranet-tmpl/prog/en/js/holds.js index eab5ae4..ba31e9f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/holds.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/holds.js @@ -50,7 +50,7 @@ $(document).ready(function() { if ( oObj.suspend == 1 ) { data += "

" + HOLD_IS_SUSPENDED; if ( oObj.suspend_until ) { - data += " " + UNTIL.replace( "_SUSPEND_UNTIL_", oObj.suspend_until_formatted ); + data += " " + UNTIL.format( oObj.suspend_until_formatted ); } data += "

"; } @@ -61,12 +61,12 @@ $(document).ready(function() { data += ITEM_IS_WAITING; if ( ! oObj.waiting_here ) { - data += " " + AT.replace("_WAITING_AT_BRANCH_", oObj.waiting_at ); + data += " " + AT.format( oObj.waiting_at ); } } else if ( oObj.transferred ) { - data += ITEM_IS_IN_TRANSIT.replace( "_FROM_BRANCH_", oObj.from_branch ); + data += ITEM_IS_IN_TRANSIT.format( oObj.from_branch ); } else if ( oObj.not_transferred ) { - data += NOT_TRANSFERRED_YET.replace( "_FROM_BRANCH_", oObj.not_transferred_by ); + data += NOT_TRANSFERRED_YET.format( oObj.not_transferred_by ); } data += ""; -- 2.0.0.rc2