Bug 10871

Summary: Confirmation message for deleting news entries is not translatable
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: I18N/L10NAssignee: Katrin Fischer <katrin.fischer>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: trivial    
Priority: P5 - low CC: f.demians, gmcharlt, tomascohen
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:
Attachments: Bug 10871: Make confirmation message for deleting news translatable
Bug 10871: Make confirmation message for deleting news translatable
[SIGNED-OFF] Bug 10871: Make confirmation message for deleting news translatable
Bug 10871: Make confirmation message for deleting news translatable

Description Katrin Fischer 2013-09-10 19:09:07 UTC
When you delete an entry from the news tool, the confirmation message is not translatable.
Comment 1 Katrin Fischer 2013-09-10 19:12:20 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2013-09-11 14:56:10 UTC
This doesn't work for me, and I think we've seen this before. If you have the _() function inside an onclick attribute it doesn't work. One solution is to define a variable to pass to the function. Example in virtualshelves/shelves.tt (line 618):

<input type="submit" class="deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);" value="Delete" />

The other solution would be to move everything into a <script> block and define the onsubmit behavior there.
Comment 3 Owen Leonard 2013-09-11 14:57:07 UTC
Sorry--to be specific: This doesn't work for me because the string is not picked up by the translator. Functionally the JavaScript works, but after running translate update I don't find the string in the po file.
Comment 4 Katrin Fischer 2013-09-11 14:57:39 UTC
My fault, sorry Owen! I will try to fix.
Comment 5 Katrin Fischer 2013-09-12 05:28:59 UTC Comment hidden (obsolete)
Comment 6 Owen Leonard 2013-09-16 18:48:50 UTC Comment hidden (obsolete)
Comment 7 Jonathan Druart 2013-09-19 10:12:24 UTC
Created attachment 21228 [details] [review]
Bug 10871: Make confirmation message for deleting news translatable

To test:
- Create a news entry in tools > news
- Delete the news entry or multiple entries by selecting them
  using the checkboxes to the left and the delete button at the
  bottom of the page.

Verify confirmation message shows up correctly with patch applied.

Bonus:
- Update one of the po files and make sure the new strings shows up
  there.

Thx Owen!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 8 Galen Charlton 2013-09-21 17:35:25 UTC
Pushed to master.  Thanks, Owen!
Comment 9 Galen Charlton 2013-09-21 17:35:58 UTC
Er, rather, thanks Katrin!
Comment 10 Tomás Cohen Arazi 2013-11-11 15:15:25 UTC
This patch has been pushed to 3.12.x, will be in 3.12.7.

Thanks Katrina!