Bug 128314 - Obscure and unmanageable long month name capitalization rules in date formats (ru-RU)
Summary: Obscure and unmanageable long month name capitalization rules in date formats...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Eike Rathke
URL:
Whiteboard: target:7.2.0
Keywords:
: 140720 (view as bug list)
Depends on:
Blocks: Number-Format
  Show dependency treegraph
 
Reported: 2019-10-22 05:46 UTC by Mike Kaganski
Modified: 2021-11-03 10:14 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2019-10-22 05:46:11 UTC
MMMM -> Декабрь (just one possibility (OK in the beginning of sentence), no way to have the other option - using lowercase)

D MMMM -> 31 декабря (OK)

D MMMM, -> 31 Декабрь, (wrong: there's never capitalizing of month name after day in Russian; wrong ending of the month name - should be "декабря," as in correct example above)

No way to have "декабрь" or "декабрь 2019" or "31 декабря, 2019".
Comment 1 Roman Kuznetsov 2019-10-22 11:23:03 UTC
Confirm in

Version: 6.4.0.0.alpha0+ (x64)
Build ID: ccfbe8b478f3daa8b5ec07a7e48dd5fbf8556811
CPU threads: 4; OS: Windows 10.0 Build 18362; UI render: default; VCL: win; 
Locale: ru-RU (ru_RU); UI-Language: en-US
Calc: threaded
Comment 2 Eike Rathke 2019-10-22 13:04:20 UTC
This is due to locale data in i18npool/source/localedata/data/ru_RU.xml and how the number formatter's rules for genitive case vs noun case kick in.

All <MonthsOfYear> (used as noun, i.e. for a single MMMM) full month names in ru_RU.xml start with a capital letter, abbreviated names start with a small letter. There is no direct way to have different casing for the same format code or month name. Maybe the new NatNum12 spell-out rules can cover that, not sure.

The <GenitiveMonths> used for the possessive genitive case (i.e. in conjunction with the day of month as in D MMMM) start with small letters.
For >D MMMM,< the trailing comma leads to the noun case being used, due to backwards compatibility with other characters following a MMMM. However, probably the comma could be exempted there (and the LongDateMonthSeparator fwiw, which happens to be a space in ru_RU.xml so works anyway).

For the glory details see https://erack.net/blog/archives/2-LibreOffice-possessive-genitive-case-and-partitive-case-month-names.html (I think those basic rules didn't change) and implementation in svl/source/numbers/zformat.cxx SvNumberformat::ImpUseMonthCase().
Comment 3 Mike Kaganski 2021-03-05 13:12:42 UTC
*** Bug 140720 has been marked as a duplicate of this bug. ***
Comment 4 Commit Notification 2021-05-14 22:36:41 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/84df9a567aa35ff84b2bd6f53432cf8ea9f4b218

Related: tdf#128314 tdf#137349 Support NatNum12 for all day and month names

It will be available in 7.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Commit Notification 2021-05-14 23:31:22 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/eb7a2bd2f1efa587fe0ebeff86e5e18760b9b465

Related: tdf#128314 tdf#137349 Add unit test for NatNum12 upper names

It will be available in 7.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2021-05-14 23:31:37 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/e8c373d1da87256933ece80b896ecd0f03c8cb43

Related: tdf#128314 Add NatNum12 modifier 'lower' attribute

It will be available in 7.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2021-05-15 00:01:00 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/cb63fad5a1967d20d067cd4ee2c8ddc7ba8ff1ea

Related: tdf#128314 Add unit test for NatNum12 lower names

It will be available in 7.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2021-05-17 15:16:07 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/def94a6b50f02682c3f04ce3171665c703c47b2c

Resolves: tdf#128314 Use GenitiveMonths name also if comma is following

It will be available in 7.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Eike Rathke 2021-05-17 15:41:06 UTC
With the latest commit 'D MMMM,' uses the same genitive case month name as 'D MMMM ' or 'D MMMM'.


@Mike:

We could change ru-RU locale data such that the noun case month names were all lower case, but that of course would affect all documents loaded in ru-RU locale. Would that be expected? Or harm? If such month name would have to start with an upper case letter in few cases then the user could assign a number format

[NatNum12 MMMM=capitalize]MMMM

The other possibility would be to keep month names with initial capitals and force lower case names using

[NatNum12 MMMM=lower]MMMM

as of the preceding commits.

However, none of the NatNum12 rules can be exported to Excel, so that would display whatever it does for MMMM. (Did they meanwhile learn about non-noun case month names somehow?)
Comment 10 Mike Kaganski 2021-05-18 06:14:56 UTC
(In reply to Eike Rathke from comment #9)
> We could change ru-RU locale data such that the noun case month names were
> all lower case, but that of course would affect all documents loaded in
> ru-RU locale. Would that be expected? Or harm?

Excel shows 'MMMM' format as "Январь", capitalizing the first letter. I suppose it's OK to keep it capitalized, and the '[NatNum12 MMMM=lower]' is fine when one wants to have it not capitalized. This would also avoid unexpected breakage of existing documents. There's an option - and that's great! :-)

> (Did they meanwhile learn about non-noun case month names somehow?)

Do you have a suggestion which formats should I test to answer reliably? :-)
Comment 11 Eike Rathke 2021-05-18 10:00:29 UTC
Basically such thing as 'D MMMM YYYY' or 'D MMMM, YYYY'
Comment 12 Mike Kaganski 2021-05-18 10:05:00 UTC
(In reply to Eike Rathke from comment #11)

No, Excel doesn't look smarter :-) It gives "1 Январь 1900" and "1 Январь, 1900", when correct would be "1 января 1900" and  "1 января, 1900". I suppose it's OK to not try to export the NatNum12 extended properties.
Comment 13 Eike Rathke 2021-05-18 15:36:53 UTC
Ok, let's set this to resolved.

@Mike:
Feel free to cherry-pick https://gerrit.libreoffice.org/c/core/+/115708 to 7-1 if you think it would be appropriate having it there already.