Bug 20511 - Seasonal prediction just in the staff language
Summary: Seasonal prediction just in the staff language
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Serials (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on: 11262
Blocks:
  Show dependency treegraph
 
Reported: 2018-04-03 15:10 UTC by Hugo Agud
Modified: 2022-08-05 15:08 UTC (History)
8 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 20511: Make seasons translatable in prediction pattern (11.07 KB, patch)
2022-02-17 15:22 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 20511: Remove translation support for short version of season (1.44 KB, patch)
2022-04-08 08:42 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 20511: Make seasons translatable in prediction pattern (11.10 KB, patch)
2022-05-31 14:33 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 20511: Remove translation support for short version of season (1.44 KB, patch)
2022-05-31 14:33 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 13614: Compiled CSS (33.28 KB, patch)
2022-06-07 14:00 UTC, Florian
Details | Diff | Splinter Review
Bug 20511: Make seasons translatable in prediction pattern (11.15 KB, patch)
2022-06-07 14:13 UTC, Florian
Details | Diff | Splinter Review
Bug 20511: Remove translation support for short version of season (1.50 KB, patch)
2022-06-07 14:14 UTC, Florian
Details | Diff | Splinter Review
Bug 20511: Make seasons translatable in prediction pattern (11.34 KB, patch)
2022-08-05 11:45 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 20511: Remove translation support for short version of season (1.50 KB, patch)
2022-08-05 11:45 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Hugo Agud 2018-04-03 15:10:46 UTC
The seasonal (season, day and monthn) prediction it doens't change according the  locale defined in the patterns, the pattern uses always the language of the staff user interface.

If you create a pattern with staff user language in spanish, it doesn't matter you configure the locale.. the serialq it will be in spanish.
Comment 1 Katrin Fischer 2018-04-04 05:24:55 UTC
I can confirm this behaviour on master.
Comment 2 Caroline Cyr La Rose 2019-12-04 15:02:54 UTC
Hi All,

I confirm this is still the case.

Test plan:
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
Comment 3 Jonathan Druart 2022-02-17 15:22:30 UTC
Created attachment 130751 [details] [review]
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
Comment 4 Owen Leonard 2022-03-03 17:45:43 UTC
(In reply to Jonathan Druart from comment #3)

> Generate new serial items and confirm that the seasons are correctly
> translated when displayed

Where will this information appear?
Comment 5 Jonathan Druart 2022-03-03 20:14:19 UTC
(In reply to Owen Leonard from comment #4)
> (In reply to Jonathan Druart from comment #3)
> 
> > Generate new serial items and confirm that the seasons are correctly
> > translated when displayed
> 
> Where will this information appear?

You should see the season translated everywhere it's displayed (not when it appears in an input however).
So on the catalogue/detail.pl tab "Subscriptions", or the subscription detail view (/serials/subscription-detail.pl?subscriptionid=1)

You need to:
gulp po:update --lang es-ES
cd misc/translate
Edit po/es-ES-messages.po, translate the season names
./translate install es-ES
restart_all (strings are cached)
Comment 6 Hugo Agud 2022-04-07 07:15:07 UTC
I a trying to test into sandbox, but i have no way of updating po.

I have seen that If I the pattern include to season like spring-summer, it only translates one of two.

sample
Número	Fecha de publicación
Vol. Primavera, Number Summer, Issue 0	04/01/2022
Vol. Verano, Number Fall, Issue 1	07/01/2022
Vol. Otoño, Number Winter, Issue 2	10/01/2022
Vol. Winter, Number Primavera, Issue 3	01/01/2023
Comment 7 Jonathan Druart 2022-04-07 13:38:57 UTC
(In reply to Hugo Agud from comment #6)
> I a trying to test into sandbox, but i have no way of updating po.
> 
> I have seen that If I the pattern include to season like spring-summer, it
> only translates one of two.
> 
> sample
> Número	Fecha de publicación
> Vol. Primavera, Number Summer, Issue 0	04/01/2022
> Vol. Verano, Number Fall, Issue 1	07/01/2022
> Vol. Otoño, Number Winter, Issue 2	10/01/2022
> Vol. Winter, Number Primavera, Issue 3	01/01/2023

How did you generate that? On which page?
Comment 8 Hugo Agud 2022-04-08 08:01:37 UTC
Hi

Pattern offer you the chance of define {x}, {y} , {z}... it is often use only one season, but there are certain serials that will need two season patter

number: springer-summer, winter-auttum for example.

when use season two times in the same pattern, koha it only translate one, perhaps it also happens with the rest of days, months...etc
Comment 9 Jonathan Druart 2022-04-08 08:35:03 UTC
(In reply to Hugo Agud from comment #8)
> Hi
> 
> Pattern offer you the chance of define {x}, {y} , {z}... it is often use
> only one season, but there are certain serials that will need two season
> patter
> 
> number: springer-summer, winter-auttum for example.
> 
> when use season two times in the same pattern, koha it only translate one,
> perhaps it also happens with the rest of days, months...etc

I don't recreate the problem.

Please post a screenshot of:
1. The "Numbering patterns" edit view
/cgi-bin/koha/serials/subscription-numberpatterns.pl?op=modify&id=XXX
2. The view where you are seeing the problem
Comment 10 Jonathan Druart 2022-04-08 08:42:08 UTC
Created attachment 133107 [details] [review]
Bug 20511: Remove translation support for short version of season

Everything get messy when we translate "Sum", then "Summer" as it's a
substring.
Comment 11 Jonathan Druart 2022-04-08 08:43:32 UTC
Hum, may have found a bug however. This patch should fix a weirdness in translation.
Comment 13 Jonathan Druart 2022-04-21 08:18:29 UTC
Yes, it should work if "Summer" is translated in the po file.
Comment 14 Jonathan Druart 2022-05-31 14:33:30 UTC
Created attachment 135504 [details] [review]
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
Comment 15 Jonathan Druart 2022-05-31 14:33:36 UTC
Created attachment 135505 [details] [review]
Bug 20511: Remove translation support for short version of season

Everything get messy when we translate "Sum", then "Summer" as it's a
substring.
Comment 16 Florian 2022-06-07 14:00:11 UTC
Created attachment 135775 [details] [review]
Bug 13614: Compiled CSS

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 17 Florian 2022-06-07 14:13:58 UTC
Created attachment 135776 [details] [review]
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
Signed-off-by: Florian Bontemps <florian.bontemps@biblibre.com>
Comment 18 Florian 2022-06-07 14:14:06 UTC
Created attachment 135777 [details] [review]
Bug 20511: Remove translation support for short version of season

Everything get messy when we translate "Sum", then "Summer" as it's a
substring.

Signed-off-by: Florian Bontemps <florian.bontemps@biblibre.com>
Comment 19 Florian 2022-06-07 14:15:31 UTC
Comment on attachment 135775 [details] [review]
Bug 13614: Compiled CSS

Apologies, not sure how that one sneaked in there
Comment 20 Katrin Fischer 2022-06-07 16:10:44 UTC
I am a little worried by the patch comments:

>Remove translation support for short version of season

>The season is stored in the DB in English and but not translated when
>displayed on the interface.

I am not sure if that is correct?

If a translated GUI is used, you will have created a string (serialseq I tihnk) using the numberpattern that contains the translation of the season.

Will this still work as before after the patches?
Comment 21 Jonathan Druart 2022-06-08 07:33:34 UTC
(In reply to Katrin Fischer from comment #20)
> I am a little worried by the patch comments:
> 
> >Remove translation support for short version of season
> 
> >The season is stored in the DB in English and but not translated when
> >displayed on the interface.
> 
> I am not sure if that is correct?
> 
> If a translated GUI is used, you will have created a string (serialseq I
> tihnk) using the numberpattern that contains the translation of the season.
> 
> Will this still work as before after the patches?

The only thing this patch is doing is to translate the season names (stored in serialseq) in the language of the interface.
If you have "Summer" and you browse in French, you will see "Été" instead. No data in DB is modified.

The short versions are not supported, "Sum" will not be translatable.
Comment 22 Katrin Fischer 2022-08-05 11:17:55 UTC
Could you please rebase?
Comment 23 Jonathan Druart 2022-08-05 11:45:43 UTC
Created attachment 138684 [details] [review]
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
Signed-off-by: Florian Bontemps <florian.bontemps@biblibre.com>
Comment 24 Jonathan Druart 2022-08-05 11:45:49 UTC
Created attachment 138685 [details] [review]
Bug 20511: Remove translation support for short version of season

Everything get messy when we translate "Sum", then "Summer" as it's a
substring.

Signed-off-by: Florian Bontemps <florian.bontemps@biblibre.com>
Comment 25 Katrin Fischer 2022-08-05 15:08:48 UTC
Hm, I think think this doesn't fix what was reported as the bug initially:

comment#1
The seasonal (season, day and month) prediction it doesn't change according the  locale defined in the patterns, the pattern uses always the language of the staff user interface.

I believe that the expectation here is that it should work like months/day of week do. You should be able to use the Locale setting of the subscription to determine the language used for the generated strings, so that it matches with what is printed on the issue. These are not meant to be multi-lingual, but to match the 'original' printed version.

What this patch does is actually the bug: It makes the description switch depending on the GUI language used.

Before this patch (tested in 20.11):

Staff interface: German
Locale: German
Preview pattern: German
Serial collection: German
Edit serials: English
OPAC: English
Database: English

With this patch set:

Staff interface: *English*
Locale: Spanish
Preview pattern: English
Serial collection: English
Edit serials: English
OPAC: English
Database: English

Update translations, switch interface to German:

Staff interface: *German*
Locale: Spanish
Preview pattern: German
Subscription detail view: German
Serial collection German
Edit serials: English (!) (input fields)
Database: English
Staff detail view: German
Late issues/claims: German

OPAC detail page - Subscription: English
OPAC brief history: English 
Full history: English

Conclusion:

1) This makes the display more consistent in the staff interface. OPAC has been missed and should work the same as staff.

2) Locale setting is ignored for seasons. This makes seasons work different to the other formatted strings. This doesn't sit well with me, because it's also an inconsistency, but I am not sure there is a fix as I believe the library used for other strings just doesn't support seasons. :( If we agree on the different behavior we should document it. Suggestion: Extend the hint below the Locale pull down by: "Not used for seasons."

3) Removing the limited support for abbreviated seasons is a little issue. We can hardly remove the setting if libraries have used it, but is it really useful if it works only for English? A compromise could be to add a hint to the entry in the formatting pull down: "Name of season (abbreviated, English)"


What could help here in the future would be a feature to define your own "formatted strings" as a list of authorised values (thought I had filed that... but can't find it). Codes would be numerical, AV would be the string used and we could use them to extend the list of available formats. I had requests for Roman numbering and we could also imagine someone wanting to do Japanese numbering or similar. This could help solve that issue. (I'll file later if people like it :) )