Bugzilla – Attachment 130751 Details for
Bug 20511
Seasonal prediction just in the staff language
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20511: Make seasons translatable in prediction pattern
Bug-20511-Make-seasons-translatable-in-prediction-.patch (text/plain), 11.07 KB, created by
Jonathan Druart
on 2022-02-17 15:22:30 UTC
(
hide
)
Description:
Bug 20511: Make seasons translatable in prediction pattern
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-02-17 15:22:30 UTC
Size:
11.07 KB
patch
obsolete
>From ee56715c67684b66d1ef4355739a92fc7c7f3b89 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 17 Feb 2022 16:20:30 +0100 >Subject: [PATCH] Bug 20511: Make seasons translatable in prediction pattern > >The season is stored in the DB in English and but not translated when >displayed on the interface. >This patch will translate the different seasons and their short form >('Spr' for 'Spring'). > >Test plan: >Update the PO of the language you like >Edit po/xx-XX-messages.po and translate the season names >Setup a new language and use it for the staff interface >Create a new subscription using the "Seasonal" subscription pattern >Generate new serial items and confirm that the seasons are correctly >translated when displayed > >Sponsored-by: Orex Digital >--- > .../en/includes/locales/subscriptions.inc | 14 +++++++++++++ > .../prog/en/modules/catalogue/detail.tt | 11 +++++++--- > .../prog/en/modules/serials/claims.tt | 3 ++- > .../prog/en/modules/serials/routing.tt | 6 ++++-- > .../en/modules/serials/serials-collection.tt | 21 ++----------------- > .../en/modules/serials/subscription-detail.tt | 3 ++- > 6 files changed, 32 insertions(+), 26 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/locales/subscriptions.inc > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/locales/subscriptions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/locales/subscriptions.inc >new file mode 100644 >index 00000000000..c32720c813c >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/locales/subscriptions.inc >@@ -0,0 +1,14 @@ >+[% USE I18N %] >+[%~ BLOCK numbering_patterns_i18n ~%] >+ >+ [%~ SET spring = I18N.t('Spring') ~%] >+ [%~ SET summer = I18N.t('Summer') ~%] >+ [%~ SET autumn = I18N.t('Autumn') ~%] >+ [%~ SET winter = I18N.t('Winter') ~%] >+ [%~ SET spr = I18N.t('Spr') ~%] >+ [%~ SET sum = I18N.t('Sum') ~%] >+ [%~ SET fal = I18N.t('Fal') ~%] >+ [%~ SET win = I18N.t('Win') ~%] >+ >+ [%~ pattern.replace('Spr', spr).replace('Sum', sum).replace('Fal', fal).replace('Win', win).replace('Spring', spring).replace('Summer', summer).replace('Autumn', autumn).replace('Winter', winter) | html ~%] >+[%~ END ~%] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index 70a22e72620..34063dadfe0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -9,6 +9,7 @@ > [% USE Price %] > [% USE TablesSettings %] > [% PROCESS 'i18n.inc' %] >+[% PROCESS 'locales/subscriptions.inc' %] > > [% IF Koha.Preference('AmazonAssocTag') %] > [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') %] >@@ -403,12 +404,16 @@ Note that permanent location is a code, and location may be an authval. > <span class="enum">[% item.enumchron | html %]</span> > [% IF ( item.serialseq && item.enumchron!=item.serialseq ) %] > <span class="sep"> -- </span> >- <span class="serialseq">[% item.serialseq | html %]</span> >+ <span class="serialseq"> >+ [% PROCESS numbering_patterns_i18n pattern => item.serialseq %] >+ </span> > [% END %] > [% ELSIF item.enumchron %] > <span class="enum">[% item.enumchron | html %]</span> > [% ELSIF item.serialseq %] >- <span class="serialseq">[% item.serialseq | html %]</span> >+ <span class="serialseq"> >+ [% PROCESS numbering_patterns_i18n pattern => item.serialseq %] >+ </span> > [% END %] > [% IF ( item.publisheddate ) %] > <span class="pubdate">([% item.publisheddate | $KohaDates %])</span> >@@ -713,7 +718,7 @@ Note that permanent location is a code, and location may be an authval. > </tr> > [% FOREACH latestserial IN subscription.latestserials %] > <tr> >- <td>[% latestserial.serialseq | html %]</td> >+ <td>[% PROCESS numbering_patterns_i18n pattern => latestserial.serialseq %]</td> > <td data-order="[% latestserial.planneddate | html %]">[% latestserial.planneddate | $KohaDates %]</td> > <td data-order="[% latestserial.publisheddate | html %]">[% latestserial.publisheddate | $KohaDates %]</td> > <td> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt >index 9c9278a7f2b..8e5a92c03c4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt >@@ -6,6 +6,7 @@ > [% INCLUDE 'doc-head-open.inc' %] > <title>[% IF ( supplierid ) -%] Claims for [% suppliername | html %] [% END %] › Claims › Serials › Koha</title> > [% INCLUDE 'doc-head-close.inc' %] >+[% PROCESS 'locales/subscriptions.inc' %] > </head> > > <body id="ser_claims" class="ser"> >@@ -156,7 +157,7 @@ > <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% missingissue.subscriptionid | uri %]">[% missingissue.title | html %]</a> > </td> > <td>[% missingissue.issn | html %]</td> >- <td>[% missingissue.serialseq | html %]</td> >+ <td>[% PROCESS numbering_patterns_i18n pattern => missingissue.serialseq %]</td> > <td> > [% IF ( missingissue.status1 ) %]<span class="status-expected">Expected</span>[% END %] > [% IF ( missingissue.status3 ) %]<span class="status-late">Late</span>[% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing.tt >index 81c33b77289..1a28b1b2db4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing.tt >@@ -7,6 +7,7 @@ > <body id="ser_routing" class="ser"> > [% INCLUDE 'header.inc' %] > [% INCLUDE 'serials-search.inc' %] >+[% PROCESS 'locales/subscriptions.inc' %] > > <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb"> > <ol> >@@ -62,9 +63,10 @@ > <select name="date_selected" id="date_selected"> > [% FOREACH date IN dates %] > [% IF ( date.selected ) %] >- <option value="[% date.serialseq | html %] ([% date.publisheddate | html %])" selected="selected">[% date.serialseq | html %] ([% date.publisheddate | $KohaDates %])</option> >+ <option value="[% date.serialseq | html %] ([% date.publisheddate | html %])" selected="selected">[% PROCESS numbering_patterns_i18n pattern => date.serialseq %] ([% date.publisheddate | $KohaDates %])</option> > [% ELSE %] >- <option value="[% date.serialseq | html %] ([% date.publisheddate | html %])">[% date.serialseq | html %] ([% date.publisheddate | $KohaDates %])</option> >+ <option value="[% date.serialseq | html %] ([% date.publisheddate | html %])">[% PROCESS numbering_patterns_i18n pattern => date.serialseq %] >+ ([% date.publisheddate | $KohaDates %])</option> > [% END %] > [% END %] > </select> [% issue | html %]</li> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt >index 69575baaccd..580f5d5689b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt >@@ -7,6 +7,7 @@ > [% INCLUDE 'doc-head-open.inc' %] > <title>Serial collection information for [% bibliotitle | html %] › Serials › Koha</title> > [% INCLUDE 'doc-head-close.inc' %] >+[% PROCESS 'locales/subscriptions.inc' %] > </head> > > <body id="ser_serials-collection" class="ser"> >@@ -246,25 +247,7 @@ > [% END %] > </td> > <td> >- [% IF ( matches = serial.serialseq.match('(.*)Spring(.*)') ) %] >- [% matches.0 | html %]Spring[% matches.1 | html %] >- [% ELSIF ( matches = serial.serialseq.match('(.*)Summer(.*)') ) %] >- [% matches.0 | html %]Summer[% matches.1 | html %] >- [% ELSIF ( matches = serial.serialseq.match('(.*)Fall(.*)') ) %] >- [% matches.0 | html %]Fall[% matches.1 | html %] >- [% ELSIF ( matches = serial.serialseq.match('(.*)Winter(.*)') ) %] >- [% matches.0 | html %]Winter[% matches.1 | html %] >- [% ELSIF ( matches = prediction.number.match('(.*)Spr(.*)') ) %] >- [% matches.0 | html %]Spr[% matches.1 | html %] >- [% ELSIF ( matches = prediction.number.match('(.*)Sum(.*)') ) %] >- [% matches.0 | html %]Sum[% matches.1 | html %] >- [% ELSIF ( matches = prediction.number.match('(.*)Fal(.*)') ) %] >- [% matches.0 | html %]Fal[% matches.1 | html %] >- [% ELSIF ( matches = prediction.number.match('(.*)Win(.*)') ) %] >- [% matches.0 | html %]Win[% matches.1 | html %] >- [% ELSE %] >- [% serial.serialseq | html %] >- [% END %] >+ [% PROCESS numbering_patterns_i18n pattern => serial.serialseq %] > </td> > <td> > [% IF ( serial.status1 ) %]Expected[% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt >index 4cccfff7dbd..492d3b0dd77 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt >@@ -10,6 +10,7 @@ > [% INCLUDE 'doc-head-open.inc' %] > <title>Details for subscription #[% subscriptionid | html %] › Serials › Koha</title> > [% INCLUDE 'doc-head-close.inc' %] >+[% PROCESS 'locales/subscriptions.inc' %] > [% Asset.css("lib/jquery/plugins/treetable/stylesheets/jquery.treetable.css") | $raw %] > </head> > >@@ -327,7 +328,7 @@ > [% FOREACH serialslis IN serialslist %] > <tr> > <td> >- [% serialslis.serialseq | html %] >+ [% PROCESS numbering_patterns_i18n pattern => serialslis.serialseq %] > </td> > <td> > [% IF serialslis.planneddate %] >-- >2.25.1
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 20511
:
130751
|
133107
|
135504
|
135505
|
135775
|
135776
|
135777
|
138684
|
138685