Bug 7599

Summary: Cart JavaScript contains untranslatable English strings
Product: Koha Reporter: Owen Leonard <oleonard>
Component: Staff interfaceAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Ian Walls <koha.sekjal>
Severity: normal    
Priority: P5 - low CC: chris, gmcharlt, jonathan.druart, paul.poulain
Version: 3.8   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 7599 - Cart JavaScript contains untranslatable English strings
Bug 7599 - [SIGNED-OFF] Cart JavaScript contains untranslatable English strings

Description Owen Leonard 2012-02-24 20:55:49 UTC
In the OPAC and staff client cart JavaScript:

function updateBasket(updated_value,target) {
	if(target){
	target.$('#basketcount').html(" <span>("+updated_value+")</span>");
	target.$('#cartDetails').html(_("Your cart contains ")+updated_value+_(" items"));
	} else {
	$('#basketcount').html(" <span>("+updated_value+")</span>");
	$('#cartDetails').html(_("Your cart contains ")+updated_value+_(" items"));
	}
	var basketcount = updated_value;
}

Not only is this untranslatable, the structure of the sentence is probably too English-centric. Perhaps, "Items in your cart: " + count ?
Comment 1 Owen Leonard 2012-05-22 18:45:11 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2012-06-01 09:21:58 UTC
Created attachment 9871 [details] [review]
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 <jonathan.druart@biblibre.com>
Strings become translatable
Comment 3 Ian Walls 2012-06-04 15:34:52 UTC
Moves string out of JS and into a variable so translation can work it's magic.  Marking Passed QA.
Comment 4 Chris Cormack 2012-06-05 15:07:48 UTC
Pushed to 3.8.x, will be in 3.8.2