Bug 30035

Summary: Wrong month name in numbering pattern
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: SerialsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: andrewfh, fridolin.somers, hagud, kyle, victor
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: Sponsored Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Sponsored-by: Orex Digital
Version(s) released in:
22.05.00,21.11.04,21.05.14
Attachments: Bug 30035: Fix month name in prediction pattern
Bug 30035: Fix month name in prediction pattern
Bug 30035: Fix month name in prediction pattern
Bug 30035: Fix failing test

Description Jonathan Druart 2022-02-07 08:49:48 UTC
In some languages (at least Catalan) the display for "month name" in the numbering pattern is wrong.
For January for instance we use "de gener" when it should be "gener".
Comment 1 Jonathan Druart 2022-02-07 08:50:52 UTC
Created attachment 130206 [details] [review]
Bug 30035: Fix month name in prediction pattern

We are using %B to display the month name but it seems that using the
CLDR pattern LLLL would be more appropriated.
https://metacpan.org/pod/DateTime#CLDR-Patterns
%B   - The full month name.
LLLL - The wide stand-alone form for the month.

For instance in Catalan:
https://metacpan.org/pod/DateTime::Locale::ca
%B will display "de gener" when LLLL will be "gener"

Test plan:
Create a new numbering pattern:
Home > Serials > Numbering patterns > New numbering pattern
Numbering formula: {X}
Label: monthname
Add: 1
Every: 1
Set back to: 1
When more than: 999
Formatting: Name of month
And test it at the bottom of the form
Locale: Catalan
The number column should contain "gener", not "de gener"
Test other locales and confirm that the output is correct (no change
expected for English, French and Spanish for instance).
Comment 2 Katrin Fischer 2022-02-19 20:40:32 UTC
Created attachment 130913 [details] [review]
Bug 30035: Fix month name in prediction pattern

We are using %B to display the month name but it seems that using the
CLDR pattern LLLL would be more appropriated.
https://metacpan.org/pod/DateTime#CLDR-Patterns
%B   - The full month name.
LLLL - The wide stand-alone form for the month.

For instance in Catalan:
https://metacpan.org/pod/DateTime::Locale::ca
%B will display "de gener" when LLLL will be "gener"

Test plan:
Create a new numbering pattern:
Home > Serials > Numbering patterns > New numbering pattern
Numbering formula: {X}
Label: monthname
Add: 1
Every: 1
Set back to: 1
When more than: 999
Formatting: Name of month
And test it at the bottom of the form
Locale: Catalan
The number column should contain "gener", not "de gener"
Test other locales and confirm that the output is correct (no change
expected for English, French and Spanish for instance).

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 3 Nick Clemens 2022-02-25 13:19:36 UTC
Created attachment 131120 [details] [review]
Bug 30035: Fix month name in prediction pattern

We are using %B to display the month name but it seems that using the
CLDR pattern LLLL would be more appropriated.
https://metacpan.org/pod/DateTime#CLDR-Patterns
%B   - The full month name.
LLLL - The wide stand-alone form for the month.

For instance in Catalan:
https://metacpan.org/pod/DateTime::Locale::ca
%B will display "de gener" when LLLL will be "gener"

Test plan:
Create a new numbering pattern:
Home > Serials > Numbering patterns > New numbering pattern
Numbering formula: {X}
Label: monthname
Add: 1
Every: 1
Set back to: 1
When more than: 999
Formatting: Name of month
And test it at the bottom of the form
Locale: Catalan
The number column should contain "gener", not "de gener"
Test other locales and confirm that the output is correct (no change
expected for English, French and Spanish for instance).

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 4 Fridolin Somers 2022-03-02 08:49:10 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄
Comment 5 Fridolin Somers 2022-03-03 20:57:11 UTC
Unit test in t/db_dependent/Serials.t fails in Jenkins for D9 D10 U18 U20.

01:00:42.317 koha_1       |     #   Failed test at t/db_dependent/Serials.t line 469.
01:00:42.317 koha_1       |     #          got: 'ene.'
01:00:42.317 koha_1       |     #     expected: 'ene'
01:00:42.317 koha_1       |     # Looks like you failed 1 test of 6.
Comment 6 Jonathan Druart 2022-03-04 07:48:55 UTC
Created attachment 131370 [details] [review]
Bug 30035: Fix failing test

Looks like there was a change in the output for Spanish.
Can be 'ene.' in older versions

Sponsored-by: Orex Digital
Comment 7 Kyle M Hall 2022-03-04 13:33:12 UTC
Pushed to 21.11.x for 21.11.04
Comment 8 Fridolin Somers 2022-03-04 18:49:44 UTC
Patch " Bug 30035: Fix failing test" pushed to master.

I see it is already in 21.11.x
Comment 9 Andrew Fuerste-Henry 2022-04-15 17:50:28 UTC
Pushed to 21.05.x for 21.05.14
Comment 10 Victor Grousset/tuxayo 2022-04-17 20:09:03 UTC
Not backported to oldoldstable (20.11.x). Feel free to ask if it's needed.
Comment 11 Victor Grousset/tuxayo 2022-06-26 18:41:31 UTC
Hi, since two months this is causing a regression on t/db_dependent/Serials.t on only Ubuntu 16.04. I can reproduce locally.

Since it's minor I might just revert it if we don't have a clue about this 😕


https://jenkins.koha-community.org/view/21.05/job/Koha_21.05_U16/198/consoleText

root@kohadevbox:koha((5b38309...))$ prove t/db_dependent/Serials.t
t/db_dependent/Serials.t .. 33/50 
    #   Failed test at t/db_dependent/Serials.t line 468.
    #          got: 'gen.'
    #     expected: 'de gen.'
    # Looks like you failed 1 test of 6.

#   Failed test '_numeration'
#   at t/db_dependent/Serials.t line 473.
# Looks like you failed 1 test of 50.
t/db_dependent/Serials.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/50 subtests 

Test Summary Report
-------------------
t/db_dependent/Serials.t (Wstat: 256 Tests: 50 Failed: 1)
  Failed test:  50
  Non-zero exit status: 1
Files=1, Tests=50,  4 wallclock secs ( 0.05 usr  0.01 sys +  3.57 cusr  0.31 csys =  3.94 CPU)
Result: FAIL
Comment 12 Victor Grousset/tuxayo 2022-07-13 22:05:54 UTC
Reverted from 21.05.x to fix Ubuntu 16.04
Comment 13 Katrin Fischer 2022-07-16 11:43:25 UTC
*** Bug 26347 has been marked as a duplicate of this bug. ***
Comment 14 Victor Grousset/tuxayo 2022-07-24 22:01:08 UTC
I didn't notice that Ubuntu 16.04 is end of life since 2021-04-30

I can reintroduce this patch it if needed.