Bug 27815

Summary: "Remove" in point of sale untranslatable
Product: Koha Reporter: Caroline Cyr La Rose <caroline.cyr-la-rose>
Component: I18N/L10NAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: andrewfh, f.demians, fridolin.somers, jonathan.druart, victor
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.04,20.05.10
Attachments: Screenshot of POS "This sale" in fr-CA
Bug 27815: "Remove" in point of sale untranslatable
Bug 27815: "Remove" in point of sale untranslatable
Bug 27815: "Remove" in point of sale untranslatable

Description Caroline Cyr La Rose 2021-02-26 19:15:17 UTC
Created attachment 117396 [details]
Screenshot of POS "This sale" in fr-CA

The "Remove" button in "This sale" in the point of sale is untranslatable.

To reproduce:
1- Enable EnablePointOfSale syspref
2- Enable UseCashRegisters syspref
3- Set up at least one cash register in Administration > Cash registers
4- Set up at least on Debit type that can be sold through POS in Administration > Debit types
5- Install at least one other language in your staff interface and switch to that language
6- Go to Point of sale and click Add next to one item for purchase
7- Notice on the right hand side where the purchased item is added, the Removed button is still in English

I checked po/fr-CA-staff-prog.po, po/fr-CA-messages.po and po/fr-CA-messages-js.po and none of them have a "Remove" string in pay.tt.
Comment 1 Owen Leonard 2021-03-01 12:39:23 UTC
Created attachment 117444 [details] [review]
Bug 27815: "Remove" in point of sale untranslatable

This patch modifies the Point of Sale template so that the "Remove"
button can be translated. The string in the JavaScript block wasn't
wrapped in the correct function.

To test, apply the patch and test that the correct strings are
translatable. In this example I'm testing fr-FR:

- Update a translation:

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

- Open the corresponding .po file for the strings pulled from
  the template: e.g. misc/translator/po/fr-FR-staff-prog.po
- Locate strings pulled from pos/pay.tt for translation to confirm the
  update, e.g.:

  #: koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt:189
  #, c-format
  msgid "Remove"
  msgstr "Enlever"

- Install the updated translation:

  > perl translate install fr-FR

- In the staff client, go to Point of Sale.
- Switch to the French translation and click the "Ajouter" button next
  to one of the items for purchase.
- In the "This sale" table, the item you added should have a
  corresponding "Enlever" button.
Comment 2 David Nind 2021-03-03 09:04:13 UTC
Created attachment 117553 [details] [review]
Bug 27815: "Remove" in point of sale untranslatable

This patch modifies the Point of Sale template so that the "Remove"
button can be translated. The string in the JavaScript block wasn't
wrapped in the correct function.

To test, apply the patch and test that the correct strings are
translatable. In this example I'm testing fr-FR:

- Update a translation:

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

- Open the corresponding .po file for the strings pulled from
  the template: e.g. misc/translator/po/fr-FR-staff-prog.po
- Locate strings pulled from pos/pay.tt for translation to confirm the
  update, e.g.:

  #: koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt:189
  #, c-format
  msgid "Remove"
  msgstr "Enlever"

- Install the updated translation:

  > perl translate install fr-FR

- In the staff client, go to Point of Sale.
- Switch to the French translation and click the "Ajouter" button next
  to one of the items for purchase.
- In the "This sale" table, the item you added should have a
  corresponding "Enlever" button.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Katrin Fischer 2021-03-04 15:19:09 UTC
Created attachment 117734 [details] [review]
Bug 27815: "Remove" in point of sale untranslatable

This patch modifies the Point of Sale template so that the "Remove"
button can be translated. The string in the JavaScript block wasn't
wrapped in the correct function.

To test, apply the patch and test that the correct strings are
translatable. In this example I'm testing fr-FR:

- Update a translation:

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

- Open the corresponding .po file for the strings pulled from
  the template: e.g. misc/translator/po/fr-FR-staff-prog.po
- Locate strings pulled from pos/pay.tt for translation to confirm the
  update, e.g.:

  #: koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt:189
  #, c-format
  msgid "Remove"
  msgstr "Enlever"

- Install the updated translation:

  > perl translate install fr-FR

- In the staff client, go to Point of Sale.
- Switch to the French translation and click the "Ajouter" button next
  to one of the items for purchase.
- In the "This sale" table, the item you added should have a
  corresponding "Enlever" button.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Jonathan Druart 2021-03-09 16:20:21 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 5 Fridolin Somers 2021-03-19 14:16:37 UTC
Pushed to 20.11.x for 20.11.04
Comment 6 Andrew Fuerste-Henry 2021-03-23 12:23:54 UTC
Pushed to 20.05.x for 20.05.10
Comment 7 Victor Grousset/tuxayo 2021-03-23 13:24:07 UTC
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.