Bug 26619 - Cart - The "Print" button is only translated when you are in "More details" mode
Summary: Cart - The "Print" button is only translated when you are in "More details" mode
Status: Pushed to master
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All Linux
: P5 - low minor (vote)
Assignee: Owen Leonard
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-06 13:30 UTC by Alexis Ripetti
Modified: 2020-11-13 21:37 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Text to go in the release notes:
Version(s) released in:
20.11.00


Attachments
Bug 26619: Cart - The "Print" button is only translated when you are in "More details" mode (1.81 KB, patch)
2020-10-20 11:46 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 26619: Cart - The "Print" button is only translated when you are in "More details" mode (1.85 KB, patch)
2020-10-24 10:31 UTC, David Nind
Details | Diff | Splinter Review
Bug 26619: Cart - The "Print" button is only translated when you are in "More details" mode (1.91 KB, patch)
2020-10-25 00:10 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Alexis Ripetti 2020-10-06 13:30:11 UTC
When you are in the shopping basket, in OPAC, the button "Print" is only translated when you are in "More details" mode.


To replicate:
1) Change the language, pick French for example
2) In OPAC, do a research
3) Click on "Add to cart" ("Ajouter au panier")  under one of the results
4) Click on "Cart" ("Panier") at the top of the page
5) See that the "Print" button is not translated in French
6) Click on "More details" ("Plus de détails")
7) See that the "Print" button is now translated in French
Comment 1 Katrin Fischer 2020-10-20 01:55:33 UTC
Confirmed on our 20.05
Comment 2 Katrin Fischer 2020-10-20 02:05:27 UTC
I had a quick look, the print button for the more details view is in the template, the other seems to come from the datatables:

koha-tmpl/intranet-tmpl/lib/datatables/datatables.min.js:0!==d.pathname.indexOf("/")&&(b+="/");return d.protocol+"//"+b+d.pathname+d.search};k.ext.buttons.print={className:"buttons-print",text:function(b){return b.i18n("buttons.print","Print")},action:function(b,a,d,g){b=a.buttons.exportData(c.extend({decodeEntities:!1},g.exportOptions));d=a.buttons.exportInfo(g);var k=a.columns(g.exportOptions.columns).flatten().map(function(b){return a.settings()[0].aoColumns[a.column(b).index()].sClass}).toArray(),m=function(b,a){for(var d="<tr>",c=0,e=b.length;c<e;c++)d+=...

Adding Owen in hope he has an idea.
Comment 3 Owen Leonard 2020-10-20 11:46:40 UTC
Created attachment 112028 [details] [review]
Bug 26619: Cart - The "Print" button is only translated when you are in "More details" mode

This patch adds the "Print" string to datatables.js so that it can be
picked up for translation.

To test, apply the patch and add some items to the cart in the OPAC.

- Open the cart. You should see a button labeled "Print."
- The print button should work correctly.

TESTING TRANSLATABILITY

- Update a translation, e.g. fr-FR:

  > cd misc/translator
  > perl translate update fr-FR

- Open the corresponding .po file for JavaScript strings,
  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from
  koha-tmpl/opac-tmpl/bootstrap/js/datatables.js for translation:

  msgid "Print"
  msgstr ""

- Edit the "msgstr" string however you want (it's just for testing).
- Install the updated translation:

   > perl translate install fr-FR

- Switch to your newly translated language in the OPAC and
  repeat the test plan above. The translated strings should appear.
Comment 4 David Nind 2020-10-24 10:31:01 UTC
Created attachment 112387 [details] [review]
Bug 26619: Cart - The "Print" button is only translated when you are in "More details" mode

This patch adds the "Print" string to datatables.js so that it can be
picked up for translation.

To test, apply the patch and add some items to the cart in the OPAC.

- Open the cart. You should see a button labeled "Print."
- The print button should work correctly.

TESTING TRANSLATABILITY

- Update a translation, e.g. fr-FR:

  > cd misc/translator
  > perl translate update fr-FR

- Open the corresponding .po file for JavaScript strings,
  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from
  koha-tmpl/opac-tmpl/bootstrap/js/datatables.js for translation:

  msgid "Print"
  msgstr ""

- Edit the "msgstr" string however you want (it's just for testing).
- Install the updated translation:

   > perl translate install fr-FR

- Switch to your newly translated language in the OPAC and
  repeat the test plan above. The translated strings should appear.

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 Katrin Fischer 2020-10-25 00:10:28 UTC
Created attachment 112431 [details] [review]
Bug 26619: Cart - The "Print" button is only translated when you are in "More details" mode

This patch adds the "Print" string to datatables.js so that it can be
picked up for translation.

To test, apply the patch and add some items to the cart in the OPAC.

- Open the cart. You should see a button labeled "Print."
- The print button should work correctly.

TESTING TRANSLATABILITY

- Update a translation, e.g. fr-FR:

  > cd misc/translator
  > perl translate update fr-FR

- Open the corresponding .po file for JavaScript strings,
  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from
  koha-tmpl/opac-tmpl/bootstrap/js/datatables.js for translation:

  msgid "Print"
  msgstr ""

- Edit the "msgstr" string however you want (it's just for testing).
- Install the updated translation:

   > perl translate install fr-FR

- Switch to your newly translated language in the OPAC and
  repeat the test plan above. The translated strings should appear.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Jonathan Druart 2020-10-25 23:07:44 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 7 Lucas Gass 2020-11-13 21:37:18 UTC
does not apply cleanly to 20.05.x, no backport 

please rebase if needed