From fb642a89dd985fda5aeb6b00f36514656204ccb1 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Tue, 1 Apr 2025 12:12:34 +0000 Subject: [PATCH] Bug 38339: Make core field descriptions translatable Test plan, before applying patches: 1) Enable ILLModule and create an ILL request (make sure it has an author and a title) 2) Install es-ES, on ktd run: koha-translate -i es-ES --dev kohadev 3) Access the ILL request on the OPAC: http://localhost:8080/cgi-bin/koha/opac-illrequests.pl?op=view&illrequest_id=1 4) Activate es-ES language from the footer. Notice 'Title' and 'Author' still show as english 5) Apply patches. restart plack and update translation koha-plack --restart kohadev koha-translate --update es-ES --dev kohadev 6) Repeat 3). Notice those labels are now translated. 7) Ensure the table renders correctly and displays the data author and title data: http://localhost:8080/cgi-bin/koha/opac-illrequests.pl --- Koha/ILL/Backend/Standard.pm | 73 ++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 40 deletions(-) diff --git a/Koha/ILL/Backend/Standard.pm b/Koha/ILL/Backend/Standard.pm index 4f8f3a5adef..47e47ea7996 100644 --- a/Koha/ILL/Backend/Standard.pm +++ b/Koha/ILL/Backend/Standard.pm @@ -912,47 +912,40 @@ Return a hashref of core fields =cut sub _get_core_fields { - - # FIXME: This should all be made translatable as is basically a - # code => description mapping. The metadata() sub is using this - # descriptions as keys. I thought this was a bug on this backend - # but it turns out opac-illrequests.tt is using those descriptions - # as keys. for example: - # [% IF request.metadata.Author %][% request.metadata.Author | html %][% ELSE %]... return { - article_author => 'Article author', - article_title => 'Article title', - associated_id => 'Associated ID', - author => 'Author', - chapter_author => 'Chapter author', - chapter => 'Chapter', - conference_date => 'Conference date', - doi => 'DOI', - editor => 'Editor', - format => 'Format', - genre => 'Genre', - institution => 'Institution', - isbn => 'ISBN', - issn => 'ISSN', - issue => 'Issue', - item_date => 'Date', - language => 'Language', - pages => 'Pages', - pagination => 'Pagination', - paper_author => 'Paper author', - paper_title => 'Paper title', - part_edition => 'Part / Edition', - publication => 'Publication', - published_date => 'Publication date', - published_place => 'Place of publication', - publisher => 'Publisher', - sponsor => 'Sponsor', - studio => 'Studio', - title => 'Title', - type => 'Type', - venue => 'Venue', - volume => 'Volume', - year => 'Year', + article_author => __('Article author'), + article_title => __('Article title'), + associated_id => __('Associated ID'), + author => __('Author'), + chapter_author => __('Chapter author'), + chapter => __('Chapter'), + conference_date => __('Conference date'), + doi => __('DOI'), + editor => __('Editor'), + format => __('Format'), + genre => __('Genre'), + institution => __('Institution'), + isbn => __('ISBN'), + issn => __('ISSN'), + issue => __('Issue'), + item_date => __('Date'), + language => __('Language'), + pages => __('Pages'), + pagination => __('Pagination'), + paper_author => __('Paper author'), + paper_title => __('Paper title'), + part_edition => __('Part / Edition'), + publication => __('Publication'), + published_date => __('Publication date'), + published_place => __('Place of publication'), + publisher => __('Publisher'), + sponsor => __('Sponsor'), + studio => __('Studio'), + title => __('Title'), + type => __('Type'), + venue => __('Venue'), + volume => __('Volume'), + year => __('Year'), }; } -- 2.39.5