From 236f4ecfb7bb348e4f099684b365ab92f586a6fc Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 23 Oct 2024 11:52:00 +0200 Subject: [PATCH] Bug 38136: Fix 'Delete' link When a new entry has been added the Delete link was wrong. Also fix translatability of "Delete" --- .../intranet-tmpl/prog/en/modules/admin/localization.tt | 3 ++- svc/localization | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt index 2ecb6347071..05da3414b21 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt @@ -269,7 +269,8 @@ if ( success.error ) { show_message({ type: 'error_on_insert', data: success }); } else { - var new_row = table.row.add( [ success.lang, success.translation, " Delete" ] ).draw().node(); + let delete_str = _("Delete"); + var new_row = table.row.add( [ success.lang, success.translation, " %s".format(escape_str(delete_str)) ] ).draw().node(); $( new_row ).attr("id", "row_id_" + success.localization_id ).data("id", success.localization_id ); show_message({ type: 'success_on_insert', data: success }); } diff --git a/svc/localization b/svc/localization index 6dd2c5c1d02..15e78030b06 100755 --- a/svc/localization +++ b/svc/localization @@ -64,8 +64,9 @@ sub add_translation { Koha::Caches->get_instance('localization')->clear_from_cache("$source:$lang"); $response->param( - lang => $localization->lang, - translation => $localization->translation, + lang => $localization->lang, + translation => $localization->translation, + localization_id => $localization->id, ); } catch { $response->param(error => 1, error_code => 'already_exists'); -- 2.34.1