| Summary: | Cart JavaScript contains untranslatable English strings | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Owen Leonard <oleonard> |
| Component: | Staff interface | Assignee: | 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 | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | 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 |
||
Created attachment 9710 [details] [review] Bug 7599 - 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. 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 Moves string out of JS and into a variable so translation can work it's magic. Marking Passed QA. Pushed to 3.8.x, will be in 3.8.2 |
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 ?