Bugzilla – Attachment 185159 Details for
Bug 40598
Improve translation of OPAC authorities include
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40598: Improve translation of OPAC authorities include
Bug-40598-Improve-translation-of-OPAC-authorities-.patch (text/plain), 9.60 KB, created by
Owen Leonard
on 2025-08-06 15:18:37 UTC
(
hide
)
Description:
Bug 40598: Improve translation of OPAC authorities include
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2025-08-06 15:18:37 UTC
Size:
9.60 KB
patch
obsolete
>From d7b5b984cd66fb62681990bcaec7446325f457e8 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 5 Aug 2025 18:35:13 +0000 >Subject: [PATCH] Bug 40598: Improve translation of OPAC authorities include > >This patch improves the markup of the OPAC's authority-information.inc >so that translatable strings are better isolated for the translation >process. > >To test, apply the patch and test that the correct strings are >translatable. In this example I'm testing fr-FR: > >- Update a translation: > > > gulp po:update --lang fr-FR > > perl misc/translator/translate update fr-FR > >- Open the corresponding .po file for the strings pulled from > the include file, e.g. > - misc/translator/po/fr-FR-messages.po > - misc/translator/po/fr-FR/fr-FR-opac-bootstrap.po >- Locate strings pulled from authority-information.inc for > translation, e.g.: > > #: koha-tmpl/opac-tmpl/bootstrap/en/includes/authority-information.inc:94 > msgctxt "A period starting from" > msgid "From: " > msgstr "" > >- Edit the "msgstr" string however you want (it's just for testing) >- Install the updated translation: > > > perl mis/translator/translate install fr-FR > >- Now go to Administration -> System preferences in the staff > interface and search for OPACAuthorIdentifiersAndInformation and make > sure that "Identifiers (024$2$a)" is checked. >- Edit a Personal Name authority record to have various personal > details: > - 024 $a [any value] $2 orcid > - 370$a and $b, 372$a, 374$a >- Edit a bibliographic record to link 100$a to that authority record. > >- Switch to your translated language in the OPAC. >- In the OPAC, locate the bibliographic record you edited. >- Check the detail page -> "Author information" tab >- Check the authority detail page in OPAC, under "Author information" > in the right-hand column. >- Labels for the information you added should be correctly translated. > >Sponsored-by: Athens County Public Libraries >--- > .../en/includes/authority-information.inc | 106 +++++++++++------- > 1 file changed, 66 insertions(+), 40 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/authority-information.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/authority-information.inc >index 4354e3b71a8..2c31209015a 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/authority-information.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/authority-information.inc >@@ -1,3 +1,6 @@ >+[% USE raw %] >+[% USE Koha %] >+[% PROCESS 'i18n.inc' %] > [% FOREACH info IN information %] > [% SWITCH info_type %] > [% CASE 'identifiers' %] >@@ -29,77 +32,100 @@ > [% CASE 'activity' %] > [% IF info.field_of_activity %] > <li> >- <span> >- Field of activity: [% info.field_of_activity | html %] >- [% IF info.start_period || info.end_period %] >- ( [%~ IF info.start_period %]from: [% info.start_period | html %][% END %] >- [% IF info.end_period %]until: [% info.end_period | html %][% END ~%] >- ) >+ <span>Field of activity: </span> >+ [% info.field_of_activity | html %] >+ [% IF info.start_period || info.end_period %] >+ ( >+ [%~ IF info.start_period %] >+ [% tp('A period starting from', 'From: ') | html %] >+ [% info.start_period | html %] > [% END %] >- </span> >+ [% IF info.end_period %] >+ [% tp('A period ending', 'Until: ') | html %] >+ [% info.end_period | html %] >+ [% END ~%] >+ ) >+ [% END %] > </li> > [% END %] > [% CASE 'address' %] > [% IF info.address %] > <li> >- <span>Address: [% info.address | html %] [% info.postal_code | html %] [% info.city | html %] [% info.country | html %]</span> >+ <span>Address: </span> >+ [% info.address | html %] [% info.postal_code | html %] [% info.city | html %] [% info.country | html %] > </li> > [% END %] > [% CASE 'associated_group' %] > [% IF info.associated_group %] > <li> >- <span> >- Associated group: [% info.associated_group | html %] >- [% IF info.start_period || info.end_period %] >- ( [%~ IF info.start_period %]from: [% info.start_period | html %][% END %] >- [% IF info.end_period %]until: [% info.end_period | html %][% END ~%] >- ) >+ <span>Associated group:</span> >+ [% info.associated_group | html %] >+ [% IF info.start_period || info.end_period %] >+ ( >+ [%~ IF info.start_period %] >+ [% tp('A period starting from', 'From: ') | html %] >+ [% info.start_period | html %] > [% END %] >- [% IF info.uri %]<p style="margin-bottom: 0;">URI: [% info.uri | html %]</p>[% END %] >- [% IF info.source_of_information %]<p style="margin-bottom: 0;">Source of information: [% info.source_of_information | html %]</p>[% END %] >- [% IF info.authority_record_number %]<p style="margin-bottom: 0;">Authority record control number or standard number: [% info.authority_record_number | html %]</p>[% END %] >- </span> >+ [% IF info.end_period %] >+ [% tp('A period ending', 'Until: ') | html %] >+ [% info.end_period | html %] >+ [% END %] >+ ) >+ [% END %] >+ [% IF info.uri %] >+ <p style="margin-bottom: 0;"><span>URI: </span>[% info.uri | html %]</p> >+ [% END %] >+ [% IF info.source_of_information %] >+ <p style="margin-bottom: 0;"><span>Source of information: </span>[% info.source_of_information | html %]</p> >+ [% END %] >+ [% IF info.authority_record_number %] >+ <p style="margin-bottom: 0;"><span>Authority record control number or standard number: </span>[% info.authority_record_number | html %]</p> >+ [% END %] > </li> > [% END %] > [% CASE 'email_address' %] > [% IF info.email_address %] >- <li> >- <span> Email address: [% info.email_address | html %] </span> >- </li> >+ <li> <span>Email address: </span> [% info.email_address | html %] </li> > [% END %] > [% CASE 'occupation' %] > [% IF info.occupation %] > <li> >- <span> >- Occupation: [% info.occupation | html %] >- [% IF info.start_period || info.end_period %] >- ( [%~ IF info.start_period %]from: [% info.start_period | html %][% END %] >- [% IF info.end_period %]until: [% info.end_period | html %][% END ~%] >- ) >+ <span>Occupation: </span> >+ [% info.occupation | html %] >+ [% IF info.start_period || info.end_period %] >+ ( >+ [%~ IF info.start_period %] >+ [% tp('A period starting from', 'From: ') | html %] >+ [% info.start_period | html %] > [% END %] >- [% IF info.uri %]<p style="margin-bottom: 0;">URI: [% info.uri | html %]</p>[% END %] >- [% IF info.source_of_information %]<p style="margin-bottom: 0;">Source of information: [% info.source_of_information | html %]</p>[% END %] >- [% IF info.authority_record_number %]<p style="margin-bottom: 0;">Authority record control number or standard number: [% info.authority_record_number | html %]</p>[% END %] >- </span> >+ [% IF info.end_period %] >+ [% tp('A period ending', 'Until: ') | html %] >+ [% info.end_period | html %] >+ [% END ~%] >+ ) >+ [% END %] >+ [% IF info.uri %] >+ <p style="margin-bottom: 0;"><span>URI: </span>[% info.uri | html %]</p> >+ [% END %] >+ [% IF info.source_of_information %] >+ <p style="margin-bottom: 0;"><span>Source of information: </span>[% info.source_of_information | html %]</p> >+ [% END %] >+ [% IF info.authority_record_number %] >+ <p style="margin-bottom: 0;"><span>Authority record control number or standard number: </span>[% info.authority_record_number | html %]</p> >+ [% END %] > </li> > [% END %] > [% CASE 'place_of_birth' %] > [% IF info.place_of_birth %] >- <li> >- <span> Place of birth: [% info.place_of_birth | html %] </span> >- </li> >+ <li> <span>Place of birth: </span>[% info.place_of_birth | html %] </li> > [% END %] > [% CASE 'place_of_death' %] > [% IF info.place_of_death %] >- <li> >- <span> Place of death: [% info.place_of_death | html %] </span> >- </li> >+ <li> <span>Place of death: </span>[% info.place_of_death | html %] </li> > [% END %] > [% CASE 'uri' %] > [% IF info.uri %] >- <li> >- <span> URI: [% info.uri | $raw | html %] </span> >- </li> >+ <li> <span>URI: </span>[% info.uri | $raw | html %] </li> > [% END %] > [% END %] > [% END %] >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 40598
: 185159