From e3d44ebfdd271ea2615561c3f37fb65862d3ffc7 Mon Sep 17 00:00:00 2001 From: Blou Date: Wed, 4 Dec 2019 11:49:01 -0500 Subject: [PATCH] Bug 24172: Allow translation of seasons in serials-edit.tt and subscription-detail.tt Seasons are not handled by locales. Those generated are stored in English in the database, and the display in serials-collection.tt is translating them. But once you click on "Edit serials" or if you go straight to the subscription's display, those are displayed as in the database: in English. This patch reproduces the same trick as in serial-collection.tt and allow for the display to be translated. NOTE: this patch's testing require knowledge of translation tools. Reproducing Caroline's test: 0- Make sure you have at least one language other than English installed 1- With staff interface in English, create a subscription with a seasonal numbering pattern and frequency, with locale in your other language 2- Check the prediction pattern, note that the season names are in English not the locale language 3- Change the staff interface to other language, redo the prediction pattern test with locale in other language, note that the season names are in other language 4- Save the subscription 5- Receive an issue, note that the season name in the "Numbered" column on serials-edit.pl is in English 6- Save your issue 7- Switch interface in other language 8- Note that the season name on serials-collection is in other language 9- If you check the database, you will see the season name is in English, even though the subscription.locale is something else 10- validate the different pages: - serials-collection.pl: display is translated - serials-edit.pl: name pulled directly from db - subscription-detail.pl: name pulled directly from db - detail.pl: name pulled directly from db - opac-detail.pl: name pulled directly from db 11- APPLY THE PATCH 12- translate the string a) ./translate update b) find the strings, translate them c) ./translate install 13- restart Plack ? 14- validate the pages again. --- .../prog/en/modules/serials/serials-edit.tt | 4 +++- .../en/modules/serials/subscription-detail.tt | 20 ++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt index 297967cc30..e206e41951 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt @@ -126,7 +126,9 @@ $(document).ready(function() { - Issue + Issue 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 03a7bc9592..dea84abf17 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 @@ -308,7 +308,25 @@ [% FOREACH serialslis IN serialslist %] - [% serialslis.serialseq | html %] + [% IF ( matches = serialslis.serialseq.match('(.*)Spring(.*)') ) %] + [% matches.0 | html %]Spring[% matches.1 | html %] + [% ELSIF ( matches = serialslis.serialseq.match('(.*)Summer(.*)') ) %] + [% matches.0 | html %]Summer[% matches.1 | html %] + [% ELSIF ( matches = serialslis.serialseq.match('(.*)Fall(.*)') ) %] + [% matches.0 | html %]Fall[% matches.1 | html %] + [% ELSIF ( matches = serialslis.serialseq.match('(.*)Winter(.*)') ) %] + [% matches.0 | html %]Winter[% matches.1 | html %] + [% ELSIF ( matches = serialslis.serialseq.match('(.*)Spr(.*)') ) %] + [% matches.0 | html %]Spr[% matches.1 | html %] + [% ELSIF ( matches = serialslis.serialseq.match('(.*)Sum(.*)') ) %] + [% matches.0 | html %]Sum[% matches.1 | html %] + [% ELSIF ( matches = serialslis.serialseq.match('(.*)Fal(.*)') ) %] + [% matches.0 | html %]Fal[% matches.1 | html %] + [% ELSIF ( matches = serialslis.serialseq.match('(.*)Win(.*)') ) %] + [% matches.0 | html %]Win[% matches.1 | html %] + [% ELSE %] + [% serialslis.serialseq | html %] + [% END %] [% IF serialslis.planneddate %] -- 2.17.1