Bug 35590

Summary: Add the translation of seasonal predictions for a chosen locale
Product: Koha Reporter: Emily-Rose Francoeur <emily-rose.francoeur>
Component: SerialsAssignee: Emily-Rose Francoeur <emily-rose.francoeur>
Status: Failed QA --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: caroline.cyr-la-rose, emily-rose.francoeur, melanie.catt, pauline.jouve, philippe.blouin, s.abouhabib, sophie.wawrzyniak, victor
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20511
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24172
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 35590: Translate the seasons when testing the numbering pattern with a selected locale
Bug 35590: Translate the seasons when testing the numbering pattern with a selected locale
Bug 35590: Translate the seasons when testing the numbering pattern with a selected locale
Bug 35590: Translate the seasons when testing the numbering pattern with a selected locale
Bug 35590: Translate the seasons when testing the numbering pattern with a selected locale
Bug 35590: Translate the seasons when testing the numbering pattern with a selected locale
Bug 35590: Translate the seasons when testing the numbering pattern with a selected locale
Bug 35590: Translate the seasons when testing the numbering pattern with a selected locale
Screenshot of the patch's result
Warning about limits of the patch test

Description Emily-Rose Francoeur 2023-12-18 14:53:11 UTC
In “Manage Numbering Pattern” (in Serials), we have the possibility to test a pattern with a specified locale. This works well for days and months (as their translations are handled by DateTime()), but it doesn't work for seasons and their abbreviations.

To reproduce the bug:
**I recommend using the "English" version of the staff interface, as the translation for the prediction pattern with the staff interface locale doesn't work well (see issues 20511 and 24172).**

1) Navigate to “Serials > Manage numbering patterns” and click on the “Edit” button for the “Seasonal” pattern.
2) Under “Test prediction pattern”:
    - Set “First issue publication date” to today's date.
    - Set “Subscription length” to “issues” and input “4”.
    - Choose a language different from the one used in the staff interface for “Locale” (so any language except English).
    - Set “Begins with” to 0 (for X) and 2023 (for Y).
3) Click on the “Test pattern” button.
    - Observe that the season names are still displayed in English.
4) In the first section of the page, within the table, change “Formatting” to “Name of season (abbreviated)”.
5) Click on the “Test pattern” button.
    - Observe that the season names are still displayed in English.
6) Navigate to a record detail page and click on "+ New" and then "New subscription".
7) Click on the “Next ->” button and then “OK”.
8) Fill in the following fields:
    - Set “First issue publication date” to today's date.
    - Set “Frequency” to your preference.
    - Set “Subscription length” to “issues” and input “4”.
    - Set “Subscription start date” to today's date.
    - Select “Seasonal” for “Numbering pattern”.
    - Choose a language different from the one used in the staff interface for “Locale” (so any language except English).
    - Set “Begins with” to 0 (for Season) and 2023 (for Year).
9) Click on the “Test pattern” button.
    - Observe that the season names are still displayed in English.
Comment 1 Emily-Rose Francoeur 2023-12-18 19:22:11 UTC
Created attachment 159981 [details] [review]
Bug 35590: Translate the seasons when testing the numbering pattern with a selected locale

This patch allows you to test a numbering pattern that uses seasons or their abbreviations with the locale of your choice. Since DateTime() cannot handle translations for seasons, the patch relies on the translations in the .po files. Therefore, you need to have the .po file installed if you want to test this patch.

TEST PLAN

Prequisites:
Install the .po files for at least one language other than the one used in your staff interface (these files should be added to the misc/translator/po/ folder). Ensure that translations for seasons (Spring, Summer, Fall, and Winter) and their abbreviations (Spr, Sum, Fal, and Win) exist (these should be in the *-staff-prog.po). In my case, I use the .po files for French Canadian translations (fr-CA) because the translations for seasons and their abbreviations already exist.

1) Apply the patch.
2) Navigate to “Serials > Manage numbering patterns” and click on the “Edit” button for the “Seasonal” pattern.
3) Under “Test prediction pattern”:
        - Set “First issue publication date” to today's date.
        - Set “Subscription length” to “issues” and input “4”.
        - Choose the language you previously installed for “Locale” (in my case, it's “Français (French)”).
        - Set “Begins with” to 0 (for X) and 2023 (for Y).
4) Click on the “Test pattern” button.
        - Observe that the season names are displayed in the other language (“Printemps Été Automne Hiver” for me).
5) In the first section of the page, within the table, change “Formatting” to “Name of season (abbreviated).”
6) Click on the “Test pattern” button.
        - Observe that the season abbreviated names are displayed in the other language (“Pri Été Aut Hiv” for me).
7) Navigate to a record detail page and click on "+ New" and then "New subscription".
8) Click on the “Next ->” button and then “OK”.
9) Fill in the following fields:
        - Set “First issue publication date” to today's date.
        - Set “Frequency” to your preference.
        - Set “Subscription length” to “issues” and input “4”.
        - Set “Subscription start date” to today's date.
        - Select “Seasonal” for “Numbering pattern”.
        - Choose a language different from the one used in the staff interface for “Locale” (any language except English).
        - Set “Begins with” to 0 (for Season) and 2023 (for Year).
10) Click on the “Test pattern” button.
        - Observe that the season names are displayed in the other language (“Printemps Été Automne Hiver” for me).
11) Run the unit tests for Serials and GetNextSeq
        - prove ./t/db_dependent/Serials.t
        - prove ./t/db_dependent/Serials/GetNextSeq.t
Comment 2 Emily-Rose Francoeur 2023-12-18 19:28:58 UTC
Created attachment 159982 [details] [review]
Bug 35590: Translate the seasons when testing the numbering pattern with a selected locale

This patch allows you to test a numbering pattern that uses seasons or their abbreviations with the locale of your choice. Since DateTime() cannot handle translations for seasons, the patch relies on the translations in the .po files. Therefore, you need to have the .po file installed if you want to test this patch.

TEST PLAN

Prequisites:
Install the .po files for at least one language other than the one used in your staff interface (these files should be added to the misc/translator/po/ folder). Ensure that translations for seasons (Spring, Summer, Fall, and Winter) and their abbreviations (Spr, Sum, Fal, and Win) exist (these should be in the *-staff-prog.po). In my case, I use the .po files for French Canadian translations (fr-CA) because the translations for seasons and their abbreviations already exist.

1) Apply the patch.
2) Navigate to "Serials > Manage numbering patterns" and click on the "Edit" button for the "Seasonal" pattern.
3) Under "Test prediction pattern":
        - Set "First issue publication date" to today's date.
        - Set "Subscription length" to "issues" and input "4".
        - Choose the language you previously installed for "Locale" (in my case, it's "Français (French)").
        - Set "Begins with" to 0 (for X) and 2023 (for Y).
4) Click on the "Test pattern" button.
        - Observe that the season names are displayed in the other language ("Printemps Été Automne Hiver" for me).
5) In the first section of the page, within the table, change "Formatting" to "Name of season (abbreviated)".
6) Click on the "Test pattern" button.
        - Observe that the season abbreviated names are displayed in the other language ("Pri Été Aut Hiv" for me).
7) Navigate to a record detail page and click on "+ New" and then "New subscription".
8) Click on the "Next ->" button and then "OK".
9) Fill in the following fields:
        - Set "First issue publication date" to today's date.
        - Set "Frequency" to your preference.
        - Set "Subscription length" to "issues" and input "4".
        - Set "Subscription start date" to today's date.
        - Select "Seasonal" for "Numbering pattern".
        - Choose a language different from the one used in the staff interface for "Locale" (any language except English).
        - Set "Begins with" to 0 (for Season) and 2023 (for Year).
10) Click on the "Test pattern" button.
        - Observe that the season names are displayed in the other language ("Printemps Été Automne Hiver" for me).
11) Run the unit tests for Serials and GetNextSeq
        - prove ./t/db_dependent/Serials.t
        - prove ./t/db_dependent/Serials/GetNextSeq.t
Comment 3 Emily-Rose Francoeur 2023-12-19 13:52:07 UTC
Created attachment 160003 [details] [review]
Bug 35590: Translate the seasons when testing the numbering pattern with a selected locale

This patch allows you to test a numbering pattern that uses seasons or their abbreviations with the locale of your choice. Since DateTime() cannot handle translations for seasons, the patch relies on the translations in the .po files. Therefore, you need to have the .po file installed if you want to test this patch.

TEST PLAN

Prequisites:
Install the .po files for at least one language other than the one used in your staff interface (these files should be added to the misc/translator/po/ folder). Ensure that translations for seasons (Spring, Summer, Fall, and Winter) and their abbreviations (Spr, Sum, Fal, and Win) exist (these should be in the *-staff-prog.po). In my case, I use the .po files for French Canadian translations (fr-CA) because the translations for seasons and their abbreviations already exist.

1) Apply the patch.
2) Navigate to "Serials > Manage numbering patterns" and click on the "Edit" button for the "Seasonal" pattern.
3) Under "Test prediction pattern":
    - Set "First issue publication date" to today's date.
    - Set "Subscription length" to "issues" and input "4".
    - Choose the language you previously installed for "Locale" (in my case, it's "Français (French)").
    - Set "Begins with" to 0 (for X) and 2023 (for Y).
4) Click on the "Test pattern" button.
    - Observe that the season names are displayed in the other language ("Printemps Été Automne Hiver" for me).
5) In the first section of the page, within the table, change "Formatting" to "Name of season (abbreviated)".
6) Click on the "Test pattern" button.
    - Observe that the season abbreviated names are displayed in the other language ("Pri Été Aut Hiv" for me).
7) Navigate to a record detail page and click on "+ New" and then "New subscription".
8) Click on the "Next ->" button and then "OK".
9) Fill in the following fields:
    - Set "First issue publication date" to today's date.
    - Set "Frequency" to your preference.
    - Set "Subscription length" to "issues" and input "4".
    - Set "Subscription start date" to today's date.
    - Select "Seasonal" for "Numbering pattern".
    - Choose a language different from the one used in the staff interface for "Locale" (any language except English).
    - Set "Begins with" to 0 (for Season) and 2023 (for Year).
10) Click on the "Test pattern" button.
    - Observe that the season names are displayed in the other language ("Printemps Été Automne Hiver" for me).
11) Run the unit tests for Serials and GetNextSeq
    - prove ./t/db_dependent/Serials.t
    - prove ./t/db_dependent/Serials/GetNextSeq.t
Comment 4 Emily-Rose Francoeur 2023-12-19 13:54:39 UTC
Created attachment 160004 [details] [review]
Bug 35590: Translate the seasons when testing the numbering pattern with a selected locale

This patch allows you to test a numbering pattern that uses seasons or their abbreviations with the locale of your choice. Since DateTime() cannot handle translations for seasons, the patch relies on the translations in the .po files. Therefore, you need to have the .po file installed if you want to test this patch.

TEST PLAN

Prequisites:
Install the .po files for at least one language other than the one used in your staff interface (these files should be added to the misc/translator/po/ folder). Ensure that translations for seasons (Spring, Summer, Fall, and Winter) and their abbreviations (Spr, Sum, Fal, and Win) exist (these should be in the *-staff-prog.po). In my case, I use the .po files for French Canadian translations (fr-CA) because the translations for seasons and their abbreviations already exist.

1) Apply the patch.
2) Navigate to "Serials > Manage numbering patterns" and click on the "Edit" button for the "Seasonal" pattern.
3) Under "Test prediction pattern":
    - Set "First issue publication date" to today's date.
    - Set "Subscription length" to "issues" and input "4".
    - Choose the language you previously installed for "Locale" (in my case, it's "Français (French)").
    - Set "Begins with" to 0 (for X) and 2023 (for Y).
4) Click on the "Test pattern" button.
    - Observe that the season names are displayed in the other language ("Printemps Été Automne Hiver" for me).
5) In the first section of the page, within the table, change "Formatting" to "Name of season (abbreviated)".
6) Click on the "Test pattern" button.
    - Observe that the season abbreviated names are displayed in the other language ("Pri Été Aut Hiv" for me).
7) Navigate to a record detail page and click on "+ New" and then "New subscription".
8) Click on the "Next ->" button and then "OK".
9) Fill in the following fields:
    - Set "First issue publication date" to today's date.
    - Set "Frequency" to your preference.
    - Set "Subscription length" to "issues" and input "4".
    - Set "Subscription start date" to today's date.
    - Select "Seasonal" for "Numbering pattern".
    - Choose a language different from the one used in the staff interface for "Locale" (any language except English).
    - Set "Begins with" to 0 (for Season) and 2023 (for Year).
10) Click on the "Test pattern" button.
    - Observe that the season names are displayed in the other language ("Printemps Été Automne Hiver" for me).
11) Run the unit tests for Serials and GetNextSeq
    - prove ./t/db_dependent/Serials.t
    - prove ./t/db_dependent/Serials/GetNextSeq.t
Comment 5 Biblibre Sandboxes 2024-01-23 10:18:05 UTC
Created attachment 161272 [details] [review]
Bug 35590: Translate the seasons when testing the numbering pattern with a selected locale

This patch allows you to test a numbering pattern that uses seasons or their abbreviations with the locale of your choice. Since DateTime() cannot handle translations for seasons, the patch relies on the translations in the .po files. Therefore, you need to have the .po file installed if you want to test this patch.

TEST PLAN

Prequisites:
Install the .po files for at least one language other than the one used in your staff interface (these files should be added to the misc/translator/po/ folder). Ensure that translations for seasons (Spring, Summer, Fall, and Winter) and their abbreviations (Spr, Sum, Fal, and Win) exist (these should be in the *-staff-prog.po). In my case, I use the .po files for French Canadian translations (fr-CA) because the translations for seasons and their abbreviations already exist.

1) Apply the patch.
2) Navigate to "Serials > Manage numbering patterns" and click on the "Edit" button for the "Seasonal" pattern.
3) Under "Test prediction pattern":
    - Set "First issue publication date" to today's date.
    - Set "Subscription length" to "issues" and input "4".
    - Choose the language you previously installed for "Locale" (in my case, it's "Français (French)").
    - Set "Begins with" to 0 (for X) and 2023 (for Y).
4) Click on the "Test pattern" button.
    - Observe that the season names are displayed in the other language ("Printemps Été Automne Hiver" for me).
5) In the first section of the page, within the table, change "Formatting" to "Name of season (abbreviated)".
6) Click on the "Test pattern" button.
    - Observe that the season abbreviated names are displayed in the other language ("Pri Été Aut Hiv" for me).
7) Navigate to a record detail page and click on "+ New" and then "New subscription".
8) Click on the "Next ->" button and then "OK".
9) Fill in the following fields:
    - Set "First issue publication date" to today's date.
    - Set "Frequency" to your preference.
    - Set "Subscription length" to "issues" and input "4".
    - Set "Subscription start date" to today's date.
    - Select "Seasonal" for "Numbering pattern".
    - Choose a language different from the one used in the staff interface for "Locale" (any language except English).
    - Set "Begins with" to 0 (for Season) and 2023 (for Year).
10) Click on the "Test pattern" button.
    - Observe that the season names are displayed in the other language ("Printemps Été Automne Hiver" for me).
11) Run the unit tests for Serials and GetNextSeq
    - prove ./t/db_dependent/Serials.t
    - prove ./t/db_dependent/Serials/GetNextSeq.t

Signed-off-by: Sheila <s.abouhabib@ifporient.org>
Comment 6 Alexandre Noel 2024-07-23 18:53:35 UTC
Created attachment 169441 [details] [review]
Bug 35590: Translate the seasons when testing the numbering pattern with a selected locale

This patch allows you to test a numbering pattern that uses seasons or their abbreviations with the locale of your choice. Since DateTime() cannot handle translations for seasons, the patch relies on the translations in the .po files. Therefore, you need to have the .po file installed if you want to test this patch.

TEST PLAN

Prequisites:
Install the .po files for at least one language other than the one used in your staff interface (these files should be added to the misc/translator/po/ folder). Ensure that translations for seasons (Spring, Summer, Fall, and Winter) and their abbreviations (Spr, Sum, Fal, and Win) exist (these should be in the *-staff-prog.po). In my case, I use the .po files for French Canadian translations (fr-CA) because the translations for seasons and their abbreviations already exist.

1) Apply the patch.
2) Navigate to "Serials > Manage numbering patterns" and click on the "Edit" button for the "Seasonal" pattern.
3) Under "Test prediction pattern":
    - Set "First issue publication date" to today's date.
    - Set "Subscription length" to "issues" and input "4".
    - Choose the language you previously installed for "Locale" (in my case, it's "Français (French)").
    - Set "Begins with" to 0 (for X) and 2023 (for Y).
4) Click on the "Test pattern" button.
    - Observe that the season names are displayed in the other language ("Printemps Été Automne Hiver" for me).
5) In the first section of the page, within the table, change "Formatting" to "Name of season (abbreviated)".
6) Click on the "Test pattern" button.
    - Observe that the season abbreviated names are displayed in the other language ("Pri Été Aut Hiv" for me).
7) Navigate to a record detail page and click on "+ New" and then "New subscription".
8) Click on the "Next ->" button and then "OK".
9) Fill in the following fields:
    - Set "First issue publication date" to today's date.
    - Set "Frequency" to your preference.
    - Set "Subscription length" to "issues" and input "4".
    - Set "Subscription start date" to today's date.
    - Select "Seasonal" for "Numbering pattern".
    - Choose a language different from the one used in the staff interface for "Locale" (any language except English).
    - Set "Begins with" to 0 (for Season) and 2023 (for Year).
10) Click on the "Test pattern" button.
    - Observe that the season names are displayed in the other language ("Printemps Été Automne Hiver" for me).
11) Run the unit tests for Serials and GetNextSeq
    - prove ./t/db_dependent/Serials.t
    - prove ./t/db_dependent/Serials/GetNextSeq.t
Comment 7 Alexandre Noel 2024-08-06 21:12:07 UTC
Created attachment 170119 [details] [review]
Bug 35590: Translate the seasons when testing the numbering pattern with a selected locale

This patch allows you to test a numbering pattern that uses seasons or their abbreviations with the locale of your choice. Since DateTime() cannot handle translations for seasons, the patch relies on the translations in the .po files. Therefore, you need to have the .po file installed if you want to test this patch.

TEST PLAN

Prequisites:
Install the .po files for at least one language other than the one used in your staff interface (these files should be added to the misc/translator/po/ folder). Ensure that translations for seasons (Spring, Summer, Fall, and Winter) and their abbreviations (Spr, Sum, Fal, and Win) exist (these should be in the *-staff-prog.po). In my case, I use the .po files for French Canadian translations (fr-CA) because the translations for seasons and their abbreviations already exist.

1) Apply the patch.
2) Navigate to "Serials > Manage numbering patterns" and click on the "Edit" button for the "Seasonal" pattern.
3) Under "Test prediction pattern":
    - Set "First issue publication date" to today's date.
    - Set "Subscription length" to "issues" and input "4".
    - Choose the language you previously installed for "Locale" (in my case, it's "Français (French)").
    - Set "Begins with" to 0 (for X) and 2023 (for Y).
4) Click on the "Test pattern" button.
    - Observe that the season names are displayed in the other language ("Printemps Été Automne Hiver" for me).
5) In the first section of the page, within the table, change "Formatting" to "Name of season (abbreviated)".
6) Click on the "Test pattern" button.
    - Observe that the season abbreviated names are displayed in the other language ("Pri Été Aut Hiv" for me).
7) Navigate to a record detail page and click on "+ New" and then "New subscription".
8) Click on the "Next ->" button and then "OK".
9) Fill in the following fields:
    - Set "First issue publication date" to today's date.
    - Set "Frequency" to your preference.
    - Set "Subscription length" to "issues" and input "4".
    - Set "Subscription start date" to today's date.
    - Select "Seasonal" for "Numbering pattern".
    - Choose a language different from the one used in the staff interface for "Locale" (any language except English).
    - Set "Begins with" to 0 (for Season) and 2023 (for Year).
10) Click on the "Test pattern" button.
    - Observe that the season names are displayed in the other language ("Printemps Été Automne Hiver" for me).
11) Run the unit tests for Serials and GetNextSeq
    - prove ./t/db_dependent/Serials.t
    - prove ./t/db_dependent/Serials/GetNextSeq.t
Comment 8 Hammat wele 2024-09-04 14:09:54 UTC
Created attachment 171032 [details] [review]
Bug 35590: Translate the seasons when testing the numbering pattern with a selected locale

This patch allows you to test a numbering pattern that uses seasons or their abbreviations with the locale of your choice. Since DateTime() cannot handle translations for seasons, the patch relies on the translations in the .po files. Therefore, you need to have the .po file installed if you want to test this patch.

TEST PLAN

Prequisites:
Install the .po files for at least one language other than the one used in your staff interface (these files should be added to the misc/translator/po/ folder). Ensure that translations for seasons (Spring, Summer, Fall, and Winter) and their abbreviations (Spr, Sum, Fal, and Win) exist (these should be in the *-staff-prog.po). In my case, I use the .po files for French Canadian translations (fr-CA) because the translations for seasons and their abbreviations already exist.

1) Apply the patch.
2) Navigate to "Serials > Manage numbering patterns" and click on the "Edit" button for the "Seasonal" pattern.
3) Under "Test prediction pattern":
    - Set "First issue publication date" to today's date.
    - Set "Subscription length" to "issues" and input "4".
    - Choose the language you previously installed for "Locale" (in my case, it's "Français (French)").
    - Set "Begins with" to 0 (for X) and 2023 (for Y).
4) Click on the "Test pattern" button.
    - Observe that the season names are displayed in the other language ("Printemps Été Automne Hiver" for me).
5) In the first section of the page, within the table, change "Formatting" to "Name of season (abbreviated)".
6) Click on the "Test pattern" button.
    - Observe that the season abbreviated names are displayed in the other language ("Pri Été Aut Hiv" for me).
7) Navigate to a record detail page and click on "+ New" and then "New subscription".
8) Click on the "Next ->" button and then "OK".
9) Fill in the following fields:
    - Set "First issue publication date" to today's date.
    - Set "Frequency" to your preference.
    - Set "Subscription length" to "issues" and input "4".
    - Set "Subscription start date" to today's date.
    - Select "Seasonal" for "Numbering pattern".
    - Choose a language different from the one used in the staff interface for "Locale" (any language except English).
    - Set "Begins with" to 0 (for Season) and 2023 (for Year).
10) Click on the "Test pattern" button.
    - Observe that the season names are displayed in the other language ("Printemps Été Automne Hiver" for me).
11) Run the unit tests for Serials and GetNextSeq
    - prove ./t/db_dependent/Serials.t
    - prove ./t/db_dependent/Serials/GetNextSeq.t
Comment 9 pjouve 2025-01-14 13:52:46 UTC
During the 2025 Hackathon KohaLA, we tested this patch.
It works well in every part of the test plan (1-10).

We're from three different french libraries.
Comment 10 pjouve 2025-01-15 11:48:45 UTC
Created attachment 176562 [details]
Screenshot of the patch's result

Hello, from Hackathon KohaLA France 2025,
I join here a screenshot, which shows the result of the patch on the serials planning.
We can see that locale language chosen matches the season language in Prediction Pattern.
Comment 11 pjouve 2025-01-15 11:57:59 UTC
Created attachment 176563 [details]
Warning about limits of the patch test

However, we see that the patch seems to work.
During the Hackathon we want to go further and we try to receive issues.
And the results weren't what we expected. As we can see on the screenshot in the column ‘Number’ we only have the year, the season doesn't appear.
We want to warn about the eventuality of the patch could not work well with serials reception.
Comment 12 Victor Grousset/tuxayo 2025-01-21 02:34:41 UTC
Unless the above is out of scope of this patch, it looks like an issue.
At least it needs to be clarified.