Bug 35590 - Add the translation of seasonal predictions for a chosen locale
Summary: Add the translation of seasonal predictions for a chosen locale
Status: Patch doesn't apply
Alias: None
Product: Koha
Classification: Unclassified
Component: Serials (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Emily-Rose Francoeur
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-18 14:53 UTC by Emily-Rose Francoeur
Modified: 2024-04-18 12:47 UTC (History)
5 users (show)

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


Attachments
Bug 35590: Translate the seasons when testing the numbering pattern with a selected locale (31.54 KB, patch)
2023-12-18 19:22 UTC, Emily-Rose Francoeur
Details | Diff | Splinter Review
Bug 35590: Translate the seasons when testing the numbering pattern with a selected locale (31.42 KB, patch)
2023-12-18 19:28 UTC, Emily-Rose Francoeur
Details | Diff | Splinter Review
Bug 35590: Translate the seasons when testing the numbering pattern with a selected locale (26.26 KB, patch)
2023-12-19 13:52 UTC, Emily-Rose Francoeur
Details | Diff | Splinter Review
Bug 35590: Translate the seasons when testing the numbering pattern with a selected locale (26.24 KB, patch)
2023-12-19 13:54 UTC, Emily-Rose Francoeur
Details | Diff | Splinter Review
Bug 35590: Translate the seasons when testing the numbering pattern with a selected locale (26.29 KB, patch)
2024-01-23 10:18 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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>