jooking / closure-library

Automatically exported from code.google.com/p/closure-library
Apache License 2.0
0 stars 1 forks source link

goog.i18n.datetimesymbols is inconsistent #531

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The date time symbols and number symbols etc from the i18n package is 
inconsistent and not following the CLDR standards even though it claims to be. 
I could not verify the generation scripts mentioned in the comments for 
dattimesymbols.js as it appears to be internal only, but there seems to be some 
data import issues.

An example is Czech:
goog.i18n.DateTimeSymbols_cs = {
  NARROWMONTHS: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
  STANDALONENARROWMONTHS: ['l', 'ú', 'b', 'd', 'k', 'č', 'č', 's', 'z', 'ř', 'l', 'p'],
  MONTHS: ['ledna', 'února', 'března', 'dubna', 'května', 'června', 'července', 'srpna', 'září', 'října', 'listopadu', 'prosince'],
  STANDALONEMONTHS: ['leden', 'únor', 'březen', 'duben', 'květen', 'červen', 'červenec', 'srpen', 'září', 'říjen', 'listopad', 'prosinec'],
  SHORTMONTHS: ['Led', 'Úno', 'Bře', 'Dub', 'Kvě', 'Čer', 'Čvc', 'Srp', 'Zář', 'Říj', 'Lis', 'Pro'],
  STANDALONESHORTMONTHS: ['1.', '2.', '3.', '4.', '5.', '6.', '7.', '8.', '9.', '10.', '11.', '12.'] }

Here, "standalone short month" is using Arabic number for no reason while 
"short month" is using "Led" which is also incorrect because of capitalizations.

I posted a more detailed thread here: 
https://groups.google.com/forum/?fromgroups=#!topic/closure-library-discuss/eRoW
csTPooc

I've also verified that this bug also happens in Chrome so I suspect the 
internal Google database itself is inconsistent. To verify, execute the 
following JS code in Chrome (the result should be "led", but Chrome gives "1.") 
: (new Date()).toLocaleDateString("cs", {month: "short"})

The correct data can be found at http://cldr.unicode.org (for example for the 
month names go here: 
http://www.unicode.org/cldr/charts/by_type/calendars.gregorian.html)

Original issue reported on code.google.com by yeecheng...@gmail.com on 23 Jan 2013 at 8:18

GoogleCodeExporter commented 9 years ago
Just for reference I also filed at bug at Chromium's issue list: 
http://code.google.com/p/chromium/issues/detail?id=171636

Original comment by yeecheng...@gmail.com on 23 Jan 2013 at 8:25

GoogleCodeExporter commented 9 years ago
Closure uses the CLDR data. It might be a bit behind, but not much.
We are currently in sync with CLDR 24, the latest released version.
There are very-very-very few tweaks that we do, and those are usually 
accompanied by a CLDR ticket.

---

From ftp.unicode.org/Public/cldr/24 download and unzip core.zip
The data for Gregorian calendar in cs.xml from is included at the end.

NARROWMONTHS: comes from monthContext with type="format" and monthWidth 
type="narrow"
CLDR 24 uses Arabic numbers for month names. This is still the case today 
(might change if you read this post sometime later): 
http://st.unicode.org/cldr-apps/v#/cs/Gregorian
If you think CLDR is wrong, please file a ticket with CLDR, or become a 
contributor to CLDR to be able to vote.

SHORTMONTHS: was changed to lowercase meantime, following CLDR (which used 
uppercase until CLDR v.21).

Chrome uses ICU4C, which uses CLDR.
The current ICU version in Chrome is 4.6 which uses CLDR 1.9, about 2 years old.
I agree that it needs an update (and it is happening).

Overall, closure is more up to date than Chrome (usually about one month behind 
the official ICU release). 

===============
<calendar type="gregorian">
  <months>
    <monthContext type="format">
      <monthWidth type="abbreviated">
        <month type="1">led</month>
        <month type="2">úno</month>
        <month type="3">bře</month>
        <month type="4">dub</month>
        <month type="5">kvě</month>
        <month type="6">čvn</month>
        <month type="7">čvc</month>
        <month type="8">srp</month>
        <month type="9">zář</month>
        <month type="10">říj</month>
        <month type="11">lis</month>
        <month type="12">pro</month>
      </monthWidth>
      <monthWidth type="narrow">
        <month type="1">1</month>
        <month type="2">2</month>
        <month type="3">3</month>
        <month type="4">4</month>
        <month type="5">5</month>
        <month type="6">6</month>
        <month type="7">7</month>
        <month type="8">8</month>
        <month type="9">9</month>
        <month type="10">10</month>
        <month type="11">11</month>
        <month type="12">12</month>
      </monthWidth>
      <monthWidth type="wide">
        <month type="1">ledna</month>
        <month type="2">února</month>
        <month type="3">března</month>
        <month type="4">dubna</month>
        <month type="5">května</month>
        <month type="6">června</month>
        <month type="7">července</month>
        <month type="8">srpna</month>
        <month type="9">září</month>
        <month type="10">října</month>
        <month type="11">listopadu</month>
        <month type="12">prosince</month>
      </monthWidth>
    </monthContext>
    <monthContext type="stand-alone">
      <monthWidth type="abbreviated">
        <month type="1">led</month>
        <month type="2">úno</month>
        <month type="3">bře</month>
        <month type="4">dub</month>
        <month type="5">kvě</month>
        <month type="6">čvn</month>
        <month type="7">čvc</month>
        <month type="8">srp</month>
        <month type="9">zář</month>
        <month type="10">říj</month>
        <month type="11">lis</month>
        <month type="12">pro</month>
      </monthWidth>
      <monthWidth type="narrow">
        <month type="1">l</month>
        <month type="2">ú</month>
        <month type="3">b</month>
        <month type="4">d</month>
        <month type="5">k</month>
        <month type="6">č</month>
        <month type="7">č</month>
        <month type="8">s</month>
        <month type="9">z</month>
        <month type="10">ř</month>
        <month type="11">l</month>
        <month type="12">p</month>
      </monthWidth>
      <monthWidth type="wide">
        <month type="1">leden</month>
        <month type="2">únor</month>
        <month type="3">březen</month>
        <month type="4">duben</month>
        <month type="5">květen</month>
        <month type="6">červen</month>
        <month type="7">červenec</month>
        <month type="8">srpen</month>
        <month type="9">září</month>
        <month type="10">říjen</month>
        <month type="11">listopad</month>
        <month type="12">prosinec</month>
      </monthWidth>
    </monthContext>
  </months>

Original comment by mn...@google.com on 3 Mar 2014 at 7:14

GoogleCodeExporter commented 9 years ago
closure is now at CLDR 26 and the data is this:

goog.i18n.DateTimeSymbols_cs = {
  NARROWMONTHS: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
  STANDALONENARROWMONTHS: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
  MONTHS: ['ledna', 'února', 'března', 'dubna', 'května', 'června', 'července', 'srpna', 'září', 'října', 'listopadu', 'prosince'],
  STANDALONEMONTHS: ['leden', 'únor', 'březen', 'duben', 'květen', 'červen', 'červenec', 'srpen', 'září', 'říjen', 'listopad', 'prosinec'],
  SHORTMONTHS: ['led', 'úno', 'bře', 'dub', 'kvě', 'čvn', 'čvc', 'srp', 'zář', 'říj', 'lis', 'pro'],
  STANDALONESHORTMONTHS: ['led', 'úno', 'bře', 'dub', 'kvě', 'čvn', 'čvc', 'srp', 'zář', 'říj', 'lis', 'pro'],
};               

Chrome also updated its ICU to version 5.2 which uses CLDR 24.

So this bug can be closed as fixed.

Original comment by mihn...@gmail.com on 2 Mar 2015 at 5:41