From 97b4b2f1dbf653d0e4d6fc7c934c8daf217fdd84 Mon Sep 17 00:00:00 2001 From: Ayoub Glizi-Vicioso Date: Mon, 2 Mar 2026 16:54:09 -0500 Subject: [PATCH] Bug 41769: Make ', by' string translatable in suggestions This fixes a translation issue in the purchase suggestions table in the staff interface - a ", by" is added between the title and the author in the suggestion column, the "by" is not translated when the language for the staff interface is a language other than English. Test plan: 1. Add another language to Koha: ./misc/translator/translate install fr-CA 2. Enable the new language in StaffInterfaceLanguages: 2.1. Go to Administration > System preferences 2.2. Search for StaffInterfaceLanguages 2.3. Check the new language 2.4. Click Save all I18N/L10N preferences 3. Create a new purchase suggestion: 3.1. Go to More > Suggestions 3.2. Click New purchase suggestion 3.3. Fill out the title AND the author at least 3.4. Click Submit your suggestion 4. View the suggestion in the table --> It says title, by author 5. Switch language --> The ", by" is still in English 6. Apply patch. 7. Run these commands to update the translation: 7.1 ./misc/translator/translate update fr-CA 7.2 ./misc/translator/translate install fr-CA 8. Reload page. 9. Notice that ", by" is now translated. --> in this instance, you will see ", par" Signed-off-by: David Nind Signed-off-by: Jonathan Druart Signed-off-by: Lucas Gass --- .../prog/en/modules/suggestion/suggestion.tt | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt index 58ddc2c063..4e5a0246bd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt @@ -1295,18 +1295,20 @@ orderable: true, render: function (data, type, row, meta) { let node = '%s'.format(row.suggestion_id, _("suggestion"), row.title); - if (row.author) node += ", by %s".format(row.author); - node += "
"; - if (row.copyright_date) node += ' © %s'.format(row.copyright_date); - if (row.volume_desc) node += '; %s:%s'.format(_("Volume"), row.volume_desc); - if (row.isbn) node += '; %s:%s'.format(_("ISBN"), row.isbn); - if (row.publisher_code) node += '; %s %s'.format(_("Published by"), row.publisher_code); - if (row.publication_year && row.publication_year != 0) node += '; %s'.format(row.publication_year); - if (row.publication_place) node += '; %s'.format(row.publication_place); - if (row.collection_title) node += '; %s'.format(row.collection_title); - if (row.item_type && row._strings.item_type.str) node += '; %s'.format(row._strings.item_type.str); - if (row.note) node += '
%s
'.format(row.note); - if (row.archived) node += '
%s'.format(_("Archived")); + if(row.author) { + node += ", %s %s".format(_("by"),row.author.escapeHtml()); + } + node += '
'; + if(row.copyright_date) node += ' © %s'.format(row.copyright_date); + if(row.volume_desc) node += '; %s:%s'.format(_("Volume"), row.volume_desc); + if(row.isbn) node += '; %s:%s'.format(_("ISBN"), row.isbn); + if(row.publisher_code) node += '; %s %s'.format(_("Published by"), row.publisher_code); + if(row.publication_year && row.publication_year != 0) node += '; %s'.format(row.publication_year); + if(row.publication_place) node += '; %s'.format(row.publication_place); + if(row.collection_title) node += '; %s'.format(row.collection_title); + if(row.item_type && row._strings.item_type.str) node += '; %s'.format(row._strings.item_type.str); + if(row.note) node += '
%s
'.format(row.note); + if(row.archived) node += '
%s'.format(_("Archived")); return node; }, },