Bug 99110 - Calc format shows incorrect translations for dates written in words in Ukrainian language
Summary: Calc format shows incorrect translations for dates written in words in Ukrain...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Localization (show other bugs)
Version:
(earliest affected)
5.0.5.2 release
Hardware: All All
: medium normal
Assignee: David Tardon
URL:
Whiteboard: target:5.2.0
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-06 06:23 UTC by sunweb
Modified: 2016-10-25 19:08 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
locale_improvements (5.88 KB, text/plain)
2016-04-07 07:26 UTC, sunweb
Details
locale_improvements (5.88 KB, text/plain)
2016-04-07 08:04 UTC, sunweb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sunweb 2016-04-06 06:23:10 UTC
How to reproduce:
Open Calc -> Moth Right Click -> Format Cells -> Numbers -> Date -> choose any format that shows month in words for example "DD MMMM YYYY"

What it shows:
30 Листопад 2015

What it should show:
30 листопада 2015

what's now -> what's expected
Січень -> січня
Лютий -> лютого
Березень -> березня
Квітень -> квітня
Травень -> травня
Червень -> червня
Липень -> липня
Серпень -> серпня
Вересень -> вересня
Жовтень -> жовтня
Листопад -> листопада
Грудень -> грудня

Also a capital letter is generally not required for dates(in our country) if day is specified though having both variant would be nice. 

I don't know if you're reusing those dates somewhere else but dates that are under "what's now" aren't useful for dates that specify the day only if there is a month and/or a year in the cell(example: 30 липня OR 30 липня 2017 OR Липень OR Липень 2017)
Comment 1 David Tardon 2016-04-06 08:06:07 UTC
The locale data description for Ukrainian is incomplete.
Comment 2 sunweb 2016-04-06 08:14:26 UTC
If there is no coding involved i might help.
Comment 3 Commit Notification 2016-04-06 08:21:26 UTC
David Tardon committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f8b6a503af8a203ed85f2c502a57c802806e5c75

tdf#99110 add genitive cases for months for uk

It will be available in 5.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2016-04-06 08:21:30 UTC
David Tardon committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=811219418cc2ca17f7ab31d13835a664a45d4acf

tdf#99110 translate reserved words for uk

It will be available in 5.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 5 Commit Notification 2016-04-06 08:21:34 UTC
David Tardon committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=97a0893f1db495830e81a9ff4d073adaa8078d74

tdf#99110 translate currency for uk

It will be available in 5.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 6 David Tardon 2016-04-06 08:24:23 UTC
(In reply to sunweb from comment #2)
> If there is no coding involved i might help.

You can check the Ukrainian words/expressions in
https://cgit.freedesktop.org/libreoffice/core/diff/i18npool/source/localedata/data/uk_UA.xml?id=f8b6a503af8a203ed85f2c502a57c802806e5c75
for mistakes.
Comment 7 sunweb 2016-04-06 08:35:15 UTC
Looks good, thank you!
Comment 8 David Tardon 2016-04-06 12:55:35 UTC
Oops, I meant https://cgit.freedesktop.org/libreoffice/core/tree/i18npool/source/localedata/data/uk_UA.xml . The commit I linked earlier is obviously correct, because I used your list...
Comment 9 sunweb 2016-04-07 07:26:00 UTC
(In reply to David Tardon from comment #8)
> Oops, I meant
> https://cgit.freedesktop.org/libreoffice/core/tree/i18npool/source/
> localedata/data/uk_UA.xml . The commit I linked earlier is obviously
> correct, because I used your list...

Overall everything is good. Though we use dot rather than slash as date separator

And "NNNNMMMM D, YYYY" produces different result rather than in English(USA)  to fix it space is needed and coma separator because of writing rules "NNNN, MMMM D, YYYY".

I've made some fixes and uploaded a txt file and added it as an attachment.
Comment 10 sunweb 2016-04-07 07:26:45 UTC
Created attachment 124146 [details]
locale_improvements
Comment 11 sunweb 2016-04-07 08:04:17 UTC
Created attachment 124149 [details]
locale_improvements

Found a few more inconsistencies. Ignore previous locale_improvements attachment.
Comment 12 sunweb 2016-04-07 09:04:34 UTC
After downloading a test build i've found out one more little problem. I am not sure if its possible to fix soon but just to let you know.

If month is located after day then it supposed to be "квітня" and if it is before the day then "Квітень".
Also it appears that dot or comma after month also result in "Квітень" instead of "квітня".

now:
D MMMM, - 7 Квітень,
MMMM D - квітня 7

expected:
D MMMM, - 7 квітня,
MMMM D - Квітень 7
Comment 13 David Tardon 2016-04-08 07:23:24 UTC
(In reply to sunweb from comment #12)
> After downloading a test build i've found out one more little problem. I am
> not sure if its possible to fix soon but just to let you know.
> 
> If month is located after day then it supposed to be "квітня" and if it is
> before the day then "Квітень".

Hm, that should be so already. I'll check.

> Also it appears that dot or comma after month also result in "Квітень"
> instead of "квітня".

Unfortunately, in this case the code assumes that the word is in nominative case. And I do not think it would be easy to change that.
Comment 14 Commit Notification 2016-04-11 05:16:54 UTC
David Tardon committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f025b7ea8d2af57fcbc8aa69a8dae636d9219ad3

tdf#99110 use the right case

It will be available in 5.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 15 Commit Notification 2016-04-11 05:16:57 UTC
sunweb committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=2c9f86854d58bf544b9c596f23844a0d857078ee

tdf#99110 more improvements for formatting dates for uk

It will be available in 5.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 16 sunweb 2016-04-11 06:52:10 UTC
(In reply to David Tardon from comment #13)
> (In reply to sunweb from comment #12)
> > Also it appears that dot or comma after month also result in "Квітень"
> > instead of "квітня".
> 
> Unfortunately, in this case the code assumes that the word is in nominative
> case. And I do not think it would be easy to change that.

Maybe it would simple to add a special character(or better yet a combination of those that aren't useful for dates) for that before or after month? At this point you can't add double and single quotes, comma and dot because it will change case to nominative. It will simplify and fix things right away and won't restrict dots, comma, etc usage.
MMMM^^ - квітня
MMMM - Квітень
Or the other way around

Or even better. Bring in case sensitivity for months(and days of week for more consistency):

- first small "m" tells that the whole month will be written in lower case, and it doesn't matter if there're some upper case letters afterwards:
mmmm - december
mMmm - december
mmMm - december
mmmM - december
...
mmmm^^ - квітня
mmmm - квітень
...
mmm - dec
mMM - dec
mmM - dec

- if all "M" are upper case then all letters are upper cased as well:
MMMM - DECEMBER
MMM - DEC
MMMM^^ - КВІТНЯ
MMMM - КВІТЕНЬ

- if first "M" is upper cased but atleast one letter afterwards is lower cased then only first letter is capitalized:
Mmmm - December
MmmM - December
MmMM - December
MMmM - December
...
Mmmm^^ - Квітня
Mmmm - Квітень

Mmm - Dec
MmM - Dec
MMm - Dec