From bee2cc9d6578116a711698dcc67eba5ddb350ee1 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 22 May 2012 14:42:42 -0400 Subject: [PATCH] Bug 7599 - [SIGNED-OFF] Cart JavaScript contains untranslatable English strings To simplify the sentence structure for better translation flexibility the message now reads: "Item in your cart: " + number Fixed in both OPAC and staff client, although I'm not sure the message is actually triggered in the staff client. Signed-off-by: Jonathan Druart Strings become translatable Signed-off-by: Paul Poulain --- koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc | 1 + koha-tmpl/intranet-tmpl/prog/en/js/basket.js | 4 ++-- koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc | 1 + koha-tmpl/opac-tmpl/prog/en/js/basket.js | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc index 116d2e1e2f..4d83a5b5e6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc @@ -57,6 +57,7 @@ var MSG_NO_RECORD_ADDED = _("No item was added to 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_NON_RESERVES_SELECTED = _("One or more selected items cannot be reserved."); [% END %] //]]> diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/basket.js b/koha-tmpl/intranet-tmpl/prog/en/js/basket.js index 5b96c1284f..2043cd63ad 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/basket.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/basket.js @@ -378,10 +378,10 @@ function showLess() { function updateBasket(updated_value,target) { if(target){ target.$('#basketcount').html(" ("+updated_value+")"); - target.$('#cartDetails').html(_("Your cart contains ")+updated_value+_(" items")); + target.$('#cartDetails').html(MSG_IN_YOUR_CART+updated_value); } else { $('#basketcount').html(" ("+updated_value+")"); - $('#cartDetails').html(_("Your cart contains ")+updated_value+_(" items")); + $('#cartDetails').html(MSG_IN_YOUR_CART+updated_value); } var basketcount = updated_value; } diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc b/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc index 3907f3466c..53a43c1f03 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc @@ -56,6 +56,7 @@ 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_ITEM_IN_CART = _("In your cart"); + var MSG_IN_YOUR_CART = _("Items in your cart: "); var MSG_ITEM_NOT_IN_CART = _("Add to your cart"); $("#cartDetails").ready(function(){ $("#cmspan").html("<\/i><\/i><\/span> "+_("Cart")+"<\/span><\/span><\/a>"); }); [% ELSE %][% IF ( virtualshelves ) %] var MSG_NO_RECORD_SELECTED = _("No item was selected");[% END %][% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/js/basket.js b/koha-tmpl/opac-tmpl/prog/en/js/basket.js index 1872ff36c3..13a2c360a4 100644 --- a/koha-tmpl/opac-tmpl/prog/en/js/basket.js +++ b/koha-tmpl/opac-tmpl/prog/en/js/basket.js @@ -400,10 +400,10 @@ function showLess() { function updateBasket(updated_value,target) { if(target){ target.$('#basketcount').html(""+updated_value+""); - target.$('#cartDetails').html(_("Your cart contains ")+updated_value+_(" items")); + target.$('#cartDetails').html(MSG_IN_YOUR_CART+updated_value); } else { $('#basketcount').html(""+updated_value+""); - $('#cartDetails').html(_("Your cart contains ")+updated_value+_(" items")); + $('#cartDetails').html(MSG_IN_YOUR_CART+updated_value); } var basketcount = updated_value; } -- 2.39.5