Bug 26647

Summary: Add translation context to cancel hold button in OPAC
Product: Koha Reporter: Timothy Alexis Vass <timothy_alexis.vass>
Component: OPACAssignee: Timothy Alexis Vass <timothy_alexis.vass>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: trivial    
Priority: P5 - low CC: aleisha, caroline.cyr-la-rose, lucas
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:
20.11.00, 20.05.06
Attachments: Bug 26647 - The Cancel button in holds table should be translated in context for Swedish
Bug 26647 - The Cancel button in holds table should be translated in context for Swedish
Bug 26647: Add translation context to cancel hold button in OPAC
Bug 26647: Add translation context to cancel hold button in OPAC

Description Timothy Alexis Vass 2020-10-09 14:52:57 UTC
In Sweden Cancel should be translated as "Ta bort" (which means 'Remove') rather than "Avbryt" in the context of Holds.
Comment 1 Timothy Alexis Vass 2020-10-09 15:05:43 UTC
Created attachment 111415 [details] [review]
Bug 26647 - The Cancel button in holds table should be translated in context for Swedish

0) Apply the patch and add a hold on an item.
1) Install Swedish language, sv-SE and change interface language to Swedish
2) Modify sv-SE-opac-bootstrap.po and add this:
   msgctxt "Cancel hold button"
   msgid "Cancel"
   msgstr "Ta bort"
3) Go to the Holds table at /cgi-bin/koha/opac-user.pl#opac-user-holds
4) Confirm that the button is translated as "Ta bort"
5) Sign off
Comment 2 Caroline Cyr La Rose 2020-10-09 18:46:23 UTC
It worked, but the msgid and the msgctxt in my sv-SE-messages.po seem to be inverted?

169 msgctxt "Cancel"
170 msgid "Cancel hold button"
171 msgstr "aaaaaaaa"

(don't mind the aaaa, I put something silly just to make sure I noticed if it worked, hehe).

It should be msgctxt Cancel hold button and msgid Cancel.

But it works, so I'm not sure.

I think in your holds-table.inc, you should write it in this order
[% tp('Cancel hold button','Cancel') | html %]
Comment 3 Timothy Alexis Vass 2020-10-12 04:47:47 UTC
Created attachment 111465 [details] [review]
Bug 26647 - The Cancel button in holds table should be translated in context for Swedish

0) Apply the patch and add a hold on an item.
1) Install Swedish language, sv-SE and change interface language to Swedish
2) Modify sv-SE-opac-bootstrap.po and add this:
   msgctxt "Cancel hold button"
   msgid "Cancel"
   msgstr "Ta bort"
3) Go to the Holds table at /cgi-bin/koha/opac-user.pl#opac-user-holds
4) Confirm that the button is translated as "Ta bort"
5) Sign off
Comment 4 Timothy Alexis Vass 2020-10-12 04:49:22 UTC
(In reply to Caroline Cyr La Rose from comment #2)
> It worked, but the msgid and the msgctxt in my sv-SE-messages.po seem to be
> inverted?

Thank you Caroline. :)
Correct patch is now attached.
Comment 5 Owen Leonard 2020-10-13 12:29:47 UTC
Created attachment 111546 [details] [review]
Bug 26647: Add translation context to cancel hold button in OPAC

0) Apply the patch and add a hold on an item.
1) Install Swedish language, sv-SE and change interface language to
   Swedish
2) Modify sv-SE-opac-bootstrap.po and add this:
   msgctxt "Cancel hold button"
   msgid "Cancel"
   msgstr "Ta bort"
3) Go to the Holds table at /cgi-bin/koha/opac-user.pl#opac-user-holds
4) Confirm that the button is translated as "Ta bort"
5) Sign off

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 6 Katrin Fischer 2020-10-13 13:34:50 UTC
Created attachment 111563 [details] [review]
Bug 26647: Add translation context to cancel hold button in OPAC

0) Apply the patch and add a hold on an item.
1) Install Swedish language, sv-SE and change interface language to
   Swedish
2) Modify sv-SE-opac-bootstrap.po and add this:
   msgctxt "Cancel hold button"
   msgid "Cancel"
   msgstr "Ta bort"
3) Go to the Holds table at /cgi-bin/koha/opac-user.pl#opac-user-holds
4) Confirm that the button is translated as "Ta bort"
5) Sign off

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 7 Katrin Fischer 2020-10-13 13:35:24 UTC
Same issue in German - will be happy to get rid of a little more jQuery :)
Comment 8 Jonathan Druart 2020-10-14 12:55:36 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 9 Lucas Gass 2020-11-13 14:56:19 UTC
backported to 20.05.x for 20.05.06
Comment 10 Aleisha Amohia 2020-11-17 04:08:26 UTC
doesn't apply cleanly to 19.11.x, please rebase