Bugzilla – Attachment 185510 Details for
Bug 40610
Update OPAC templates to improve ease of translation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40610: Update OPAC templates to improve ease of translation
Bug-40610-Update-OPAC-templates-to-improve-ease-of.patch (text/plain), 10.72 KB, created by
Owen Leonard
on 2025-08-18 12:30:05 UTC
(
hide
)
Description:
Bug 40610: Update OPAC templates to improve ease of translation
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2025-08-18 12:30:05 UTC
Size:
10.72 KB
patch
obsolete
>From 54ef519d35f5cee1b29897b9b6c55abc63a643bf Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 15 Aug 2025 16:18:46 +0000 >Subject: [PATCH] Bug 40610: Update OPAC templates to improve ease of > translation > >This patch updates the markup structure of some OPAC include files in >order to make the translation process easier. > >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 and locate the updated strings. > > - misc/translator/po/fr-FR-messages.po > - opac-tmpl/bootstrap/en/includes/biblio-title.inc lines 4 & 5 > - opac-tmpl/bootstrap/en/includes/date-format.inc lines 4, 6, 8 > - opac-tmpl/bootstrap/en/includes/holds-table.inc lines 132 & 135 > - opac-tmpl/bootstrap/en/includes/masthead.inc line 498 > > - misc/translator/po/fr-FR/fr-FR-opac-bootstrap.po > - opac-tmpl/bootstrap/en/includes/biblio-title-head.inc > - opac-tmpl/bootstrap/en/includes/holds-table.inc line 129 & 141 > >- Edit the "msgstr" string however you want (it's just for testing). >- Remove the "fuzzy, " text if it's there. >- Install the updated translation: > > > perl mis/translator/translate install fr-FR > >- Switch to your translated language in the OPAC. >- Confirm that the strings you translated show up correctly on these > pages: > - The page title when viewing a bibliographic record detail page for > a record without a title. > - On a user summary page, under the hold tab: > - A hold that is waiting > - A hold that is in transit >- In Administration -> Identity providers define a new identity provider > (it doesn't have to be functional). > - In the OPAC, test that the "Log in with [identity provider]" link is > correct in each of the three login forms: > - The modal triggered from the link in the header > - The form in the right-hand sidebar > - The form you see if you navigate directly to a user-related page > e.g. /cgi-bin/koha/opac-user.pl >- The changes to date-format.inc are only visible if JS is turned off > because Flatpickr hides the format hint when it loads. > >Sponsored-by: Athens County Public Libraries >--- > .../bootstrap/en/includes/biblio-title-head.inc | 3 ++- > .../opac-tmpl/bootstrap/en/includes/biblio-title.inc | 2 +- > .../opac-tmpl/bootstrap/en/includes/date-format.inc | 12 +++++++++++- > .../opac-tmpl/bootstrap/en/includes/holds-table.inc | 12 +++++++----- > .../opac-tmpl/bootstrap/en/includes/masthead.inc | 2 +- > .../opac-tmpl/bootstrap/en/modules/opac-auth.tt | 2 +- > .../opac-tmpl/bootstrap/en/modules/opac-main.tt | 2 +- > .../opac-tmpl/bootstrap/en/modules/opac-reserve.tt | 1 + > 8 files changed, 25 insertions(+), 11 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/biblio-title-head.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/biblio-title-head.inc >index 1ef7664a317..64d0ae93d6f 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/biblio-title-head.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/biblio-title-head.inc >@@ -1,7 +1,8 @@ >+[% PROCESS 'i18n.inc' %] > [% IF ( biblio.title ) %] > [% biblio.title | html %] > [% ELSE %] >- No title >+ [% t("No title") | html %] > [% END %] > [%~ SET subtitles = biblio.subtitle.split(' \| ') ~%] > [%~ FOREACH subtitle IN subtitles ~%] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/biblio-title.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/biblio-title.inc >index d37640599f1..1151a00e70f 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/biblio-title.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/biblio-title.inc >@@ -2,7 +2,7 @@ > [%- IF ( link ) -%] > <a href="[%- PROCESS biblio_a_href biblionumber => biblio.biblionumber -%]" class="title">[% PROCESS 'show-biblio-title' %]</a> > [%- ELSIF (deleted) -%] >- <span class="deleted-biblio">(Deleted bibliographic record) [%- PROCESS 'show-biblio-title' -%]</span> >+ <span class="deleted-biblio"> [% t("(Deleted bibliographic record)") | html %] [%- PROCESS 'show-biblio-title' -%] </span> > [%- ELSE -%] > [%- PROCESS 'show-biblio-title' -%] > [%- END -%] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/date-format.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/date-format.inc >index f651b74eb0c..c31490acadc 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/date-format.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/date-format.inc >@@ -1 +1,11 @@ >-<span class="dateformat">[% IF ( dateformat == "us" ) %](MM/DD/YYYY)[% ELSIF ( dateformat == "metric" ) %](DD/MM/YYYY)[% ELSE %](YYYY-MM-DD)[% END %]</span> >+[% FILTER collapse %] >+ <span class="dateformat"> >+ [% IF ( dateformat == "us" ) %] >+ [% t("(MM/DD/YYYY)") | html %] >+ [% ELSIF ( dateformat == "metric" ) %] >+ [% t("(DD/MM/YYYY)") | html %] >+ [% ELSE %] >+ [% t("(YYYY-MM-DD)") | html %] >+ [% END %] >+ </span> >+[% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc >index 2df921a1dbc..a73820c0f1c 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc >@@ -71,7 +71,7 @@ > [% IF ( HOLD.expirationdate ) %] > [% HOLD.expirationdate | $KohaDates %] > [% ELSE %] >- Never expires >+ <span>Never expires</span> > [% END %] > [% ELSE %] > - >@@ -126,17 +126,19 @@ > [% IF ( HOLD.is_waiting ) %] > <i class="fa fa-exclamation-circle text-warning" aria-hidden="true"></i> > [% IF ( HOLD.is_at_destination ) %] >- Item waiting at <strong> [% HOLD.branch.branchname | html %]</strong> >+ <span>Item waiting at <strong> [% HOLD.branch.branchname | html %]</strong></span> > [% IF ( HOLD.desk_id ) %], [% HOLD.desk.desk_name | html %],[% END %] > [% IF ( HOLD.waitingdate ) %] >- since [% HOLD.waitingdate | $KohaDates %] >+ [% tp("On hold since [waiting date]", "since") | html %] >+ [% HOLD.waitingdate | $KohaDates %] > [% IF HOLD.expirationdate %] >- until [% HOLD.expirationdate | $KohaDates %] >+ [% tp("On hold until [expiration date]", "until") | html %] >+ [% HOLD.expirationdate | $KohaDates %] > [% END %] > [% END %] > <input type="hidden" name="pickup" value="[% HOLD.branchcode | html %]" /> > [% ELSE %] >- Item in transit to <strong> [% Branches.GetName( HOLD.branchcode ) | html %]</strong> <input type="hidden" name="pickup" value="[% HOLD.branchcode | html %]" /> >+ <span>Item in transit to</span> <strong> [% Branches.GetName( HOLD.branchcode ) | html %]</strong> <input type="hidden" name="pickup" value="[% HOLD.branchcode | html %]" /> > [% END %] > [% ELSE %] > [% IF ( HOLD.is_in_transit ) %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >index 18e38980f2c..326c8cec22e 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >@@ -495,7 +495,7 @@ > [% ELSE %] > <i class="fa fa-user" aria-hidden="true"></i> > [% END %] >- Log in with [% provider.description | html %] >+ [% tx("Log in with {identity_provider}", { identity_provider = provider.description } ) | html %] > </a> > </p> > [% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt >index 6d6c135cc1a..2c61dbf1573 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt >@@ -182,7 +182,7 @@ > [% ELSE %] > <i class="fa fa-user" aria-hidden="true"></i> > [% END %] >- Log in with [% provider.description | html %] >+ [% tx("Log in with {identity_provider}", { identity_provider = provider.description } ) | html %] > </a> > </p> > [% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >index 4dc8edba89c..ea503fb2d63 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >@@ -184,7 +184,7 @@ > [% ELSE %] > <i class="fa fa-user" aria-hidden="true"></i> > [% END %] >- Log in with [% provider.description | html %] >+ [% tx("Log in with {identity_provider}", { identity_provider = provider.description } ) | html %] > </a> > </p> > [% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >index 6a7fb94e4f8..abf0a7f4175 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >@@ -5,6 +5,7 @@ > [% USE Price %] > [% USE ItemTypes %] > [% USE AuthorisedValues %] >+[% PROCESS 'i18n.inc' %] > [% SET reserve_input_type = 'radio' %] > [% IF ( Koha.Preference('DisplayMultiItemHolds') ) %] > [% SET reserve_input_type = 'checkbox' %] >-- >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 40610
: 185510