Bug 38339

Summary: Standard backend _get_core_fields are not translatable
Product: Koha Reporter: Pedro Amorim <pedro.amorim>
Component: ILLAssignee: Pedro Amorim <pedro.amorim>
Status: Pushed to main --- QA Contact: Tomás Cohen Arazi (tcohen) <tomascohen>
Severity: normal    
Priority: P5 - low CC: pedro.amorim, tomascohen
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38340
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
25.05.00
Circulation function:
Bug Depends on:    
Bug Blocks: 38340, 39444    
Attachments: Bug 38339: Preparation: Access value of attribute by its key, not by display label
Bug 38339: Make core field descriptions translatable
Bug 38339: Preparation: Access value of attribute by its key, not by display label
Bug 38339: Make core field descriptions translatable
Bug 38339: Make core field descriptions translatable
Bug 38339: Make core field descriptions translatable

Description Pedro Amorim 2024-11-04 12:01:23 UTC
Following FIXME lines on ILL/Backend/Standard.pm:

    # 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 %]...
Comment 1 Pedro Amorim 2025-04-01 12:42:07 UTC Comment hidden (obsolete)
Comment 2 Pedro Amorim 2025-04-01 12:42:09 UTC Comment hidden (obsolete)
Comment 3 Pedro Amorim 2025-04-01 12:54:54 UTC Comment hidden (obsolete)
Comment 4 Pedro Amorim 2025-04-01 12:54:56 UTC Comment hidden (obsolete)
Comment 5 Magnus Enger 2025-04-03 13:39:47 UTC
Created attachment 180529 [details] [review]
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

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Comment 6 Pedro Amorim 2025-04-10 11:12:40 UTC
Marking this as duplicate of bug 39600 as the work done there implicitly fixes the issue described here.

*** This bug has been marked as a duplicate of bug 39600 ***
Comment 7 Pedro Amorim 2025-04-10 15:52:47 UTC
Reopening this and leaving just the i18n patch, making it depend on bug 39600 for the reasons stated above.
Comment 8 Tomás Cohen Arazi (tcohen) 2025-04-17 19:15:10 UTC
Created attachment 181136 [details] [review]
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

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 9 Katrin Fischer 2025-04-25 14:55:44 UTC
Is this not breaking this line in the OPAC?

<td> [% IF request.metadata.Author %][% request.metadata.Author | html %][% ELSE %]<span>N/A</span>[% END %] </td>


If we translate Author?
Comment 10 Katrin Fischer 2025-04-25 15:00:08 UTC
Tomas says this is fixed later on, so adding "additional_work_needed" as a reminder to check back on this once we got through the tree.
Comment 11 Katrin Fischer 2025-04-25 16:36:24 UTC
Pushed for 25.05!

Well done everyone, thank you!
Comment 12 Katrin Fischer 2025-05-16 15:23:40 UTC
(In reply to Katrin Fischer from comment #9)
> Is this not breaking this line in the OPAC?
> 
> <td> [% IF request.metadata.Author %][% request.metadata.Author | html %][%
> ELSE %]<span>N/A</span>[% END %] </td>
> 
> 
> If we translate Author?

The line in question doesn't appear to exist anymore. Assuming fixed.