From f39f6e81daf60886c7daad896f40f9a4e7173aa2 Mon Sep 17 00:00:00 2001 From: Shi Yao Wang Date: Fri, 27 May 2022 10:52:08 -0400 Subject: [PATCH] Bug 30028: Fix patron message delete confirmation to be translatable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make the message deletion confirmation popup translatable. Test plan uses fr-CA translations. Test plan: 1) Switch language to french (fr-CA) If you do not have the translations, go to misc/translator then do ./translate install fr-CA After it is done, go to administration > global system preference > l18N/L10N then select Français (fr-CA) under language preference. Refresh then you should be able to switch languages. 2) Add a message to a patron account from your own branch (or make sure AllowAllMessageDeletion is on) 3) Click "Delete" next to the message --> a confirmation message appears "Are you sure you want to delete this message? This cannot be undone." with options "Cancel" and "OK". 4) Apply the patch 5) Write a translation in misc/translator/po/fr-CA-messages-js.po : msgid "Are you sure you want to delete this message? This cannot be undone." msgstr "Êtes-vous sûr de vouloir supprimer ce message? Cette opération est irréversible." 6) Refresh the translations by going to misc/translator and execute ./translate install fr-CA 7) Refresh and click "Delete" again --> now the confirmation message is "Êtes-vous sûr de vouloir supprimer ce message? Cette opération est irréversible." with options "Cancel" and "OK" Signed-off-by: David Nind Signed-off-by: Jonathan Druart --- koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc | 2 +- koha-tmpl/intranet-tmpl/prog/js/members-menu.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc index b9ad41336f7..cb99f267e7c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc @@ -310,7 +310,7 @@ "[% patron_message.message | html %]" [% IF patron_message.branchcode == Branches.GetLoggedInBranchcode OR Koha.Preference('AllowAllMessageDeletion') %] - Delete + Delete [% END %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/members-menu.js b/koha-tmpl/intranet-tmpl/prog/js/members-menu.js index 0d70178bfeb..7a3336aebf7 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/members-menu.js +++ b/koha-tmpl/intranet-tmpl/prog/js/members-menu.js @@ -47,6 +47,10 @@ $(document).ready(function(){ }); } + $(".delete_message").click(function(){ + return window.confirm( __("Are you sure you want to delete this message? This cannot be undone.") ); + }); + $("#updatechild, #patronflags, #renewpatron, #deletepatron, #exportbarcodes").tooltip(); $("#exportcheckins").click(function(){ export_barcodes(); -- 2.25.1