8132494: Wrong CLDR resource bundle names for legacy ISO language codes
authornaoto
Wed, 05 Aug 2015 07:41:28 -0700
changeset 32030 f2c22ba89d0f
parent 32029 a5538163e144
child 32031 687635f86b21
8132494: Wrong CLDR resource bundle names for legacy ISO language codes Reviewed-by: okutsu
jdk/make/src/classes/build/tools/cldrconverter/Bundle.java
jdk/make/src/classes/build/tools/cldrconverter/CLDRConverter.java
jdk/test/sun/text/resources/LocaleData.cldr
--- a/jdk/make/src/classes/build/tools/cldrconverter/Bundle.java	Wed Aug 05 13:40:18 2015 +0300
+++ b/jdk/make/src/classes/build/tools/cldrconverter/Bundle.java	Wed Aug 05 07:41:28 2015 -0700
@@ -148,6 +148,13 @@
         return id;
     }
 
+    String getJavaID() {
+        // Tweak ISO compatibility for bundle generation
+        return id.replaceFirst("^he", "iw")
+            .replaceFirst("^id", "in")
+            .replaceFirst("^yi", "ji");
+    }
+
     boolean isRoot() {
         return "root".equals(id);
     }
--- a/jdk/make/src/classes/build/tools/cldrconverter/CLDRConverter.java	Wed Aug 05 13:40:18 2015 +0300
+++ b/jdk/make/src/classes/build/tools/cldrconverter/CLDRConverter.java	Wed Aug 05 07:41:28 2015 -0700
@@ -433,35 +433,35 @@
                 Map<String, Object> localeNamesMap = extractLocaleNames(targetMap, bundle.getID());
                 if (!localeNamesMap.isEmpty() || bundle.isRoot()) {
                     metaInfo.get("LocaleNames").add(toLanguageTag(bundle.getID()));
-                    bundleGenerator.generateBundle("util", "LocaleNames", bundle.getID(), true, localeNamesMap, BundleType.OPEN);
+                    bundleGenerator.generateBundle("util", "LocaleNames", bundle.getJavaID(), true, localeNamesMap, BundleType.OPEN);
                 }
             }
             if (bundleTypes.contains(Bundle.Type.CURRENCYNAMES)) {
                 Map<String, Object> currencyNamesMap = extractCurrencyNames(targetMap, bundle.getID(), bundle.getCurrencies());
                 if (!currencyNamesMap.isEmpty() || bundle.isRoot()) {
                     metaInfo.get("CurrencyNames").add(toLanguageTag(bundle.getID()));
-                    bundleGenerator.generateBundle("util", "CurrencyNames", bundle.getID(), true, currencyNamesMap, BundleType.OPEN);
+                    bundleGenerator.generateBundle("util", "CurrencyNames", bundle.getJavaID(), true, currencyNamesMap, BundleType.OPEN);
                 }
             }
             if (bundleTypes.contains(Bundle.Type.TIMEZONENAMES)) {
                 Map<String, Object> zoneNamesMap = extractZoneNames(targetMap, bundle.getID());
                 if (!zoneNamesMap.isEmpty() || bundle.isRoot()) {
                     metaInfo.get("TimeZoneNames").add(toLanguageTag(bundle.getID()));
-                    bundleGenerator.generateBundle("util", "TimeZoneNames", bundle.getID(), true, zoneNamesMap, BundleType.TIMEZONE);
+                    bundleGenerator.generateBundle("util", "TimeZoneNames", bundle.getJavaID(), true, zoneNamesMap, BundleType.TIMEZONE);
                 }
             }
             if (bundleTypes.contains(Bundle.Type.CALENDARDATA)) {
                 Map<String, Object> calendarDataMap = extractCalendarData(targetMap, bundle.getID());
                 if (!calendarDataMap.isEmpty() || bundle.isRoot()) {
                     metaInfo.get("CalendarData").add(toLanguageTag(bundle.getID()));
-                    bundleGenerator.generateBundle("util", "CalendarData", bundle.getID(), true, calendarDataMap, BundleType.PLAIN);
+                    bundleGenerator.generateBundle("util", "CalendarData", bundle.getJavaID(), true, calendarDataMap, BundleType.PLAIN);
                 }
             }
             if (bundleTypes.contains(Bundle.Type.FORMATDATA)) {
                 Map<String, Object> formatDataMap = extractFormatData(targetMap, bundle.getID());
                 if (!formatDataMap.isEmpty() || bundle.isRoot()) {
                     metaInfo.get("FormatData").add(toLanguageTag(bundle.getID()));
-                    bundleGenerator.generateBundle("text", "FormatData", bundle.getID(), true, formatDataMap, BundleType.PLAIN);
+                    bundleGenerator.generateBundle("text", "FormatData", bundle.getJavaID(), true, formatDataMap, BundleType.PLAIN);
                 }
             }
 
--- a/jdk/test/sun/text/resources/LocaleData.cldr	Wed Aug 05 13:40:18 2015 +0300
+++ b/jdk/test/sun/text/resources/LocaleData.cldr	Wed Aug 05 07:41:28 2015 -0700
@@ -2630,49 +2630,49 @@
 LocaleNames/en_SG/VC=St. Vincent & Grenadines
 LocaleNames/en_SG/WF=Wallis & Futuna
 #in
-FormatData/in/MonthNames/0=Jan
-FormatData/in/MonthNames/1=Feb
-FormatData/in/MonthNames/2=Mar
-FormatData/in/MonthNames/3=Apr
-FormatData/in/MonthNames/4=May
-FormatData/in/MonthNames/5=Jun
-FormatData/in/MonthNames/6=Jul
-FormatData/in/MonthNames/7=Aug
-FormatData/in/MonthNames/8=Sep
-FormatData/in/MonthNames/9=Oct
-FormatData/in/MonthNames/10=Nov
-FormatData/in/MonthNames/11=Dec
+FormatData/in/MonthNames/0=Januari
+FormatData/in/MonthNames/1=Februari
+FormatData/in/MonthNames/2=Maret
+FormatData/in/MonthNames/3=April
+FormatData/in/MonthNames/4=Mei
+FormatData/in/MonthNames/5=Juni
+FormatData/in/MonthNames/6=Juli
+FormatData/in/MonthNames/7=Agustus
+FormatData/in/MonthNames/8=September
+FormatData/in/MonthNames/9=Oktober
+FormatData/in/MonthNames/10=November
+FormatData/in/MonthNames/11=Desember
 FormatData/in/MonthNames/12=
 FormatData/in/MonthAbbreviations/0=Jan
 FormatData/in/MonthAbbreviations/1=Feb
 FormatData/in/MonthAbbreviations/2=Mar
 FormatData/in/MonthAbbreviations/3=Apr
-FormatData/in/MonthAbbreviations/4=May
+FormatData/in/MonthAbbreviations/4=Mei
 FormatData/in/MonthAbbreviations/5=Jun
 FormatData/in/MonthAbbreviations/6=Jul
-FormatData/in/MonthAbbreviations/7=Aug
+FormatData/in/MonthAbbreviations/7=Agt
 FormatData/in/MonthAbbreviations/8=Sep
-FormatData/in/MonthAbbreviations/9=Oct
+FormatData/in/MonthAbbreviations/9=Okt
 FormatData/in/MonthAbbreviations/10=Nov
-FormatData/in/MonthAbbreviations/11=Dec
-FormatData/in/DayNames/0=Sun
-FormatData/in/DayNames/1=Mon
-FormatData/in/DayNames/2=Tue
-FormatData/in/DayNames/3=Wed
-FormatData/in/DayNames/4=Thu
-FormatData/in/DayNames/5=Fri
-FormatData/in/DayNames/6=Sat
-FormatData/in/DayAbbreviations/0=Sun
-FormatData/in/DayAbbreviations/1=Mon
-FormatData/in/DayAbbreviations/2=Tue
-FormatData/in/DayAbbreviations/3=Wed
-FormatData/in/DayAbbreviations/4=Thu
-FormatData/in/DayAbbreviations/5=Fri
-FormatData/in/DayAbbreviations/6=Sat
-FormatData/in/Eras/0=BCE
-FormatData/in/Eras/1=CE
+FormatData/in/MonthAbbreviations/11=Des
+FormatData/in/DayNames/0=Minggu
+FormatData/in/DayNames/1=Senin
+FormatData/in/DayNames/2=Selasa
+FormatData/in/DayNames/3=Rabu
+FormatData/in/DayNames/4=Kamis
+FormatData/in/DayNames/5=Jumat
+FormatData/in/DayNames/6=Sabtu
+FormatData/in/DayAbbreviations/0=Min
+FormatData/in/DayAbbreviations/1=Sen
+FormatData/in/DayAbbreviations/2=Sel
+FormatData/in/DayAbbreviations/3=Rab
+FormatData/in/DayAbbreviations/4=Kam
+FormatData/in/DayAbbreviations/5=Jum
+FormatData/in/DayAbbreviations/6=Sab
+FormatData/in/Eras/0=SM
+FormatData/in/Eras/1=M
 FormatData/in/NumberPatterns/0=#,##0.###
-FormatData/in/NumberPatterns/1=\u00a4\u00a0#,##0.00
+FormatData/in/NumberPatterns/1=\u00a4#,##0.00
 FormatData/in/NumberPatterns/2=#,##0%
 #FormatData/in/NumberElements/0=<MISSING!>
 #FormatData/in/NumberElements/1=<MISSING!>
@@ -2685,14 +2685,14 @@
 #FormatData/in/NumberElements/8=<MISSING!>
 #FormatData/in/NumberElements/9=<MISSING!>
 #FormatData/in/NumberElements/10=<MISSING!>
-FormatData/in/TimePatterns/0=HH:mm:ss zzzz
-FormatData/in/TimePatterns/1=HH:mm:ss z
-FormatData/in/TimePatterns/2=HH:mm:ss
-FormatData/in/TimePatterns/3=HH:mm
-FormatData/in/DatePatterns/0=y MMMM d, EEEE
-FormatData/in/DatePatterns/1=y MMMM d
-FormatData/in/DatePatterns/2=y MMM d
-FormatData/in/DatePatterns/3=y-MM-dd
+FormatData/in/TimePatterns/0=HH.mm.ss zzzz
+FormatData/in/TimePatterns/1=HH.mm.ss z
+FormatData/in/TimePatterns/2=HH.mm.ss
+FormatData/in/TimePatterns/3=HH.mm
+FormatData/in/DatePatterns/0=EEEE, dd MMMM y
+FormatData/in/DatePatterns/1=d MMMM y
+FormatData/in/DatePatterns/2=d MMM y
+FormatData/in/DatePatterns/3=dd/MM/yy
 FormatData/in/DateTimePatterns/0={1} {0}
 #LocaleNames/in/ab=<MISSING!>
 #LocaleNames/in/am=<MISSING!>
@@ -2848,14 +2848,14 @@
 #LocaleNames/in/YE=<MISSING!>
 #LocaleNames/in/ZA=<MISSING!>
 #in_ID
-FormatData/in_ID/TimePatterns/0=HH:mm:ss zzzz
-FormatData/in_ID/TimePatterns/1=HH:mm:ss z
-FormatData/in_ID/TimePatterns/2=HH:mm:ss
-FormatData/in_ID/TimePatterns/3=HH:mm
-FormatData/in_ID/DatePatterns/0=y MMMM d, EEEE
-FormatData/in_ID/DatePatterns/1=y MMMM d
-FormatData/in_ID/DatePatterns/2=y MMM d
-FormatData/in_ID/DatePatterns/3=y-MM-dd
+FormatData/in_ID/TimePatterns/0=HH.mm.ss zzzz
+FormatData/in_ID/TimePatterns/1=HH.mm.ss z
+FormatData/in_ID/TimePatterns/2=HH.mm.ss
+FormatData/in_ID/TimePatterns/3=HH.mm
+FormatData/in_ID/DatePatterns/0=EEEE, dd MMMM y
+FormatData/in_ID/DatePatterns/1=d MMMM y
+FormatData/in_ID/DatePatterns/2=d MMM y
+FormatData/in_ID/DatePatterns/3=dd/MM/yy
 FormatData/in_ID/DateTimePatterns/0={1} {0}
 #CurrencyNames/in_ID/IDR/0=<MISSING!>
 #en_MT
@@ -7316,20 +7316,20 @@
 FormatData/it/DayNarrows/5=V
 FormatData/it/DayNarrows/6=S
 
-FormatData/iw/DayNarrows/0=S
-FormatData/iw/DayNarrows/1=M
-FormatData/iw/DayNarrows/2=T
-FormatData/iw/DayNarrows/3=W
-FormatData/iw/DayNarrows/4=T
-FormatData/iw/DayNarrows/5=F
-FormatData/iw/DayNarrows/6=S
-FormatData/iw/standalone.DayNarrows/0=S
-FormatData/iw/standalone.DayNarrows/1=M
-FormatData/iw/standalone.DayNarrows/2=T
-FormatData/iw/standalone.DayNarrows/3=W
-FormatData/iw/standalone.DayNarrows/4=T
-FormatData/iw/standalone.DayNarrows/5=F
-FormatData/iw/standalone.DayNarrows/6=S
+FormatData/iw/DayNarrows/0=\u05d0\u05f3
+FormatData/iw/DayNarrows/1=\u05d1\u05f3
+FormatData/iw/DayNarrows/2=\u05d2\u05f3
+FormatData/iw/DayNarrows/3=\u05d3\u05f3
+FormatData/iw/DayNarrows/4=\u05d4\u05f3
+FormatData/iw/DayNarrows/5=\u05d5\u05f3
+FormatData/iw/DayNarrows/6=\u05e9\u05f3
+FormatData/iw/standalone.DayNarrows/0=\u05d0\u05f3
+FormatData/iw/standalone.DayNarrows/1=\u05d1\u05f3
+FormatData/iw/standalone.DayNarrows/2=\u05d2\u05f3
+FormatData/iw/standalone.DayNarrows/3=\u05d3\u05f3
+FormatData/iw/standalone.DayNarrows/4=\u05d4\u05f3
+FormatData/iw/standalone.DayNarrows/5=\u05d5\u05f3
+FormatData/iw/standalone.DayNarrows/6=\u05e9\u05f3
 
 FormatData/ja/DayNarrows/0=\u65e5
 FormatData/ja/DayNarrows/1=\u6708