fedora - formatting dates correctly: genitive month names in ......2017/01/27 · state of the work...
TRANSCRIPT
![Page 1: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/1.jpg)
Formatting Dates Correctly:Genitive Month Names in strftime()
State of the work in progress
Rafał Lużyń[email protected]
![Page 2: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/2.jpg)
WARNING
UPDATE: Just before showing these slides in public I learned that this problem probably
does not apply to the Czech language. Please ignore any references to the Czech
language in the following slides.
Other languages should be reviewed, too.
![Page 3: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/3.jpg)
Question: Who uses
GNOMEor: MATE, Cinnamon, Ubuntu Unity, etc…
AND
Czech localesor: Belarusian, Catalan, Croatian, Finnish, Greek, Lithuanian, Polish, Russian, Slovak, Ukrainian
?
UPDATEUPDATE
Czech probably is not affectedCzech probably is not affected
![Page 4: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/4.jpg)
Question: Who uses
GNOMEor: MATE, Cinnamon, Ubuntu Unity, etc…
AND
Czech localesor: Belarusian, Catalan, Croatian, Finnish, Greek, Lithuanian, Polish, Russian, Slovak, Ukrainian (and several more…)
?
UPDATE: Czech probably UPDATE: Czech probably is not affectedis not affected
![Page 5: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/5.jpg)
What’s wrong here?
![Page 6: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/6.jpg)
What’s wrong here:
UPDATEUPDATE
Czech probably is correctCzech probably is correct
![Page 7: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/7.jpg)
We need genitive cases!
● Some (most?) Slavic languages have different suffixes for different cases
● The same: Baltic languages, Finnish, Greek● The rules are too complex to be resolved
programmatically● Some Romance languages use “de” to create
a genitive case but need “d’” if the word begins with a vowel
![Page 8: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/8.jpg)
About 20 languages affected
● Armenian● Asturian● Belarusian● Catalan● Croatian● Czech● Finnish● Greek● Kashubian● Lithuanian
● Ossetian● Polish● Russian● Scottish Gaelic● Silesian● Slovak● Sorbian (Upper, Lower)● Ukrainian● Walloon● …anyone else?
UPDATE: Czech probably is not UPDATE: Czech probably is not affectedaffected
![Page 9: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/9.jpg)
About 20 languages affected
![Page 10: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/10.jpg)
Is this severe at all?
Yes. Linux desktops promote bad grammar.
This makes them unsuitable for schools.
![Page 11: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/11.jpg)
Suggestion:
If we need genitives then why not just reword all months names to
genitive?
![Page 12: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/12.jpg)
Here is what Blogspot did:
UPDATE for those who don’t know: this is all incorrect. UPDATE for those who don’t know: this is all incorrect. Nominative cases are required here.Nominative cases are required here.
![Page 13: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/13.jpg)
We need both cases!
UPDATEUPDATECzech probably is correct Czech probably is correct
herehere
![Page 14: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/14.jpg)
Why the bug?
● All GNOME/GTK+ applications use this function:
gchar *g_date_time_format (GDateTime *datetime,
const gchar *format);
● It is inspired by strftime():size_t strftime(char *s, size_t max, const char *format,
const struct tm *tm);
![Page 15: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/15.jpg)
Format specifiers
● %b – abbreviated month name,
● %B – full month name,
● %m – month (decimal number),
● %Om – month (alternative numeric system),
● and so on…
But there are no genitive cases!
![Page 16: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/16.jpg)
Implementations
Both these functions internally use nl_langinfo():
● MON_1 – localized January,
● MON_2 – localized February,
● ABMON_1 – localized Jan,
● ABMON_2 – localized Feb,
● and so on…
Again no genitive cases!
![Page 17: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/17.jpg)
So it’s a bug in glibc!
https://sourceware.org/bugzilla/show_bug.cgi?id=10871
![Page 18: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/18.jpg)
Solution
● Add ALTMON_1…ALTMON_12 items to nl_langinfo()
● Add %OB format specifier to strftime()and anything derived, inspired etc.
● Let %OB return the same string as nl_langinfo (ALTMON_1…ALTMON_12)
![Page 19: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/19.jpg)
Solution
● Let nl_langinfo (MON_…) and strftime ("%B") return the genitive case
● Let nl_langinfo (ALTMON_…) and strftime ("%OB") return the nominative case (the same as nl_langinfo (MON_…) and strftime ("%B") return now)
Wait, WHAT?!
![Page 20: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/20.jpg)
Why this incompatibility?
● *BSD family (including FreeBSD, OpenBSD, OS X, iOS) do the same since 1990s
● POSIX also agreed for the same solution in 2010 to be included in a future release:
http://austingroupbugs.net/view.php?id=258(but has not yet included it in any release)
● Otherwise we would never be compatible with POSIX and BSD
● How should we implement g_date_time_format() from glib2?Compatible with glibc? Compatible with POSIX? Compatible with OS X? Platform dependent (nonportable)?
![Page 21: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/21.jpg)
Why this incompatibility?
● Month names are probably more often used to display dates than standalone
● This approach will automatically fix all applications which display dates incorrectly
● Also, unfortunately, will break some which display months standalone (e.g., calendars)
![Page 22: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/22.jpg)
Near future
● nl_langinfo (ALTMON_…) and strftime ("%OB") will be added to glibc
● But only provided that it is not yet defined which of MON_x/ALTMON_x and %B/%OB is nominative and which is genitive
● In case of strftime(), language communities may choose different approaches
● We want to hear feedback from translators, application developers, users,…
![Page 23: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/23.jpg)
Why not go one step further?
● Do we also need strftime ("%Ob") (abbreviated alternative month name)?
![Page 24: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/24.jpg)
Why not go one step further?
Nominative:● …● мар● апр● май● июн● июл● …
Genitive:● …● мар● апр● мая● июн● июл● …
● Yes, we need it at least for Russian:
![Page 25: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/25.jpg)
Why not go one step further?
● No other system supports it● Fedora will be First™ :-) (again…)
![Page 26: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/26.jpg)
Who does it correctly
*BSD family (FreeBSD, OpenBSD, OS X, iOS):
● nl_langinfo(nl_item item) accepts ALTMON_1…ALTMON_12
● strftime() supports "%OB"
![Page 27: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/27.jpg)
Who does it correctly
Microsoft:
● GetDateFormat() and GetDateFormatEx(): automatically select genitive form when both "d" and "MMMM" appear in the format stringDo you want to see the case where it does not work?
● .NET Framework: System.Globalization.DateTimeFormatInfo supports MonthGenitiveNames and AbbreviatedMonthGenitiveNames
![Page 28: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/28.jpg)
Who does it correctly
LibICU(International Components for Unicode):
Date format string includes:● "L",
● "LL",
● "LLL",
● "LLLL" – month names standalone (nominative)
● "M",
● "MM",
● "MMM",
● "MMMM" – month names in full date context (genitive)
![Page 29: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/29.jpg)
Who does it correctly
KDE and QT:(based on libicu)
![Page 30: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/30.jpg)
Who does it correctly
Android
● Written in Java● java.text.SimpleDateFormat internally based on
ICU● This means: able to handle nominative and genitive
months names correctly!● Sometimes locales are incomplete● Sometimes applications use it incorrectly
![Page 31: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/31.jpg)
Who does it correctly
Ukrainian locales in glibc (sic!)
● Dirty hack● "%OY", "%Om", "%Od", "%OH", "%OM", "%OS" were supposed to
use alternative numeric symbols● They defined alternative digits as: "0", " "січня , " "лютого , " "березня , and so on…
● Result: "%Om" displays the month name in a genitive case
● Fallout: "%OY", "%Od", "%OH", "%OM", "%OS" also display months
● nl_langinfo() remains not fixed
![Page 32: Fedora - Formatting Dates Correctly: Genitive Month Names in ......2017/01/27 · State of the work in progress Rafał Lużyński rluzynski@fedoraproject.org WARNING UPDATE: Just](https://reader035.vdocuments.us/reader035/viewer/2022062607/60245ed45d7e68529311f387/html5/thumbnails/32.jpg)
Why not yet finished?
● It’s not easy to tweak in glibc● 200+ locales and zillions of applications on
multiple hardwares, don’t break any of them!● No reviewers from Eastern Europe so far
Contributors needed!