Bug 7599 - Cart JavaScript contains untranslatable English strings
Summary: Cart JavaScript contains untranslatable English strings
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: 3.8
Hardware: All All
: P5 - low normal
Assignee: Owen Leonard
QA Contact: Ian Walls
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-24 20:55 UTC by Owen Leonard
Modified: 2013-12-05 19:59 UTC (History)
4 users (show)

See Also:
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 (4.09 KB, patch)
2012-05-22 18:45 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 7599 - [SIGNED-OFF] Cart JavaScript contains untranslatable English strings (4.15 KB, patch)
2012-06-01 09:21 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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