From f065141ddc23ab4cf8436af719042d0faf52b04b Mon Sep 17 00:00:00 2001 From: Naoto Sato Date: Tue, 12 Dec 2017 10:21:58 -0800 Subject: [PATCH] 8176841: Additional Unicode Language-Tag Extensions 8189134: New system properties for the default Locale extensions 8190918: Retrieve the region specific data regardless of language in locale 8191349: Add a new method in j.t.f.DateTimeFormatter to reflect Unicode extensions Reviewed-by: scolebourne, lancea, rriggs, rgoel, nishjain --- .../tools/cldrconverter/CLDRConverter.java | 269 +++--- .../tools/cldrconverter/LDMLParseHandler.java | 90 +- .../NumberingSystemsParseHandler.java | 31 +- .../ResourceBundleGenerator.java | 55 +- .../SupplementDataParseHandler.java | 81 +- .../cldrconverter/TimeZoneParseHandler.java | 64 ++ .../share/classes/java/text/DateFormat.java | 7 + .../classes/java/text/DateFormatSymbols.java | 14 +- .../java/text/DecimalFormatSymbols.java | 16 +- .../share/classes/java/text/NumberFormat.java | 9 +- .../classes/java/text/SimpleDateFormat.java | 2 +- .../java/time/format/DateTimeFormatter.java | 58 +- .../time/format/DateTimeFormatterBuilder.java | 10 +- .../time/format/DateTimeTextProvider.java | 3 +- .../java/time/format/DecimalStyle.java | 5 + .../java/time/temporal/ChronoField.java | 7 +- .../classes/java/time/temporal/IsoFields.java | 5 +- .../java/time/temporal/WeekFields.java | 9 +- .../share/classes/java/util/Calendar.java | 42 +- .../share/classes/java/util/Currency.java | 38 +- .../share/classes/java/util/Locale.java | 241 +++-- .../java/util/spi/LocaleNameProvider.java | 53 +- .../classes/sun/launcher/LauncherHelper.java | 2 +- .../cldr/CLDRCalendarDataProviderImpl.java | 106 +++ .../util/cldr/CLDRLocaleProviderAdapter.java | 35 +- .../provider/CalendarDataProviderImpl.java | 13 +- .../locale/provider/CalendarDataUtility.java | 59 +- .../provider/DateFormatProviderImpl.java | 19 +- .../provider/JRELocaleProviderAdapter.java | 4 +- .../locale/provider/LocaleDataMetaInfo.java | 13 +- .../provider/LocaleNameProviderImpl.java | 24 +- .../util/locale/provider/LocaleResources.java | 14 +- .../provider/NumberFormatProviderImpl.java | 11 +- .../provider/SPILocaleProviderAdapter.java | 40 +- .../locale/provider/TimeZoneNameUtility.java | 17 +- .../sun/util/resources/LocaleNames.properties | 5 +- .../cldr/resources/common/bcp47/timezone.xml | 470 ++++++++++ .../cldr/resources/common/dtd/ldmlBCP47.dtd | 74 ++ test/java/util/Calendar/Bug8185841.java | 278 ------ .../time/format/TestUnicodeExtension.java | 852 ++++++++++++++++++ test/jdk/java/util/Calendar/Bug4302966.java | 6 +- .../java/util/Calendar/CalendarDataTest.java | 108 +++ .../util/Locale/bcp47u/CalendarTests.java | 158 ++++ .../util/Locale/bcp47u/CurrencyTests.java | 106 +++ .../util/Locale/bcp47u/DefaultLocaleTest.java | 46 + .../util/Locale/bcp47u/DisplayNameTests.java | 109 +++ .../java/util/Locale/bcp47u/FormatTests.java | 167 ++++ .../java/util/Locale/bcp47u/SymbolsTests.java | 91 ++ .../Locale/bcp47u/SystemPropertyTests.java | 99 ++ .../bcp47u/spi/LocaleNameProviderTests.java | 52 ++ .../provider/foo/LocaleNameProviderImpl.java | 65 ++ .../bcp47u/spi/provider/module-info.java | 27 + test/jdk/sun/text/resources/LocaleData.cldr | 294 +++--- .../sun/text/resources/LocaleDataTest.java | 2 +- .../plugins/IncludeLocalesPluginTest.java | 46 +- 55 files changed, 3631 insertions(+), 890 deletions(-) create mode 100644 make/jdk/src/classes/build/tools/cldrconverter/TimeZoneParseHandler.java create mode 100644 src/java.base/share/classes/sun/util/cldr/CLDRCalendarDataProviderImpl.java create mode 100644 src/jdk.localedata/share/classes/sun/util/cldr/resources/common/bcp47/timezone.xml create mode 100644 src/jdk.localedata/share/classes/sun/util/cldr/resources/common/dtd/ldmlBCP47.dtd delete mode 100644 test/java/util/Calendar/Bug8185841.java create mode 100644 test/jdk/java/time/test/java/time/format/TestUnicodeExtension.java create mode 100644 test/jdk/java/util/Calendar/CalendarDataTest.java create mode 100644 test/jdk/java/util/Locale/bcp47u/CalendarTests.java create mode 100644 test/jdk/java/util/Locale/bcp47u/CurrencyTests.java create mode 100644 test/jdk/java/util/Locale/bcp47u/DefaultLocaleTest.java create mode 100644 test/jdk/java/util/Locale/bcp47u/DisplayNameTests.java create mode 100644 test/jdk/java/util/Locale/bcp47u/FormatTests.java create mode 100644 test/jdk/java/util/Locale/bcp47u/SymbolsTests.java create mode 100644 test/jdk/java/util/Locale/bcp47u/SystemPropertyTests.java create mode 100644 test/jdk/java/util/Locale/bcp47u/spi/LocaleNameProviderTests.java create mode 100644 test/jdk/java/util/Locale/bcp47u/spi/provider/foo/LocaleNameProviderImpl.java create mode 100644 test/jdk/java/util/Locale/bcp47u/spi/provider/module-info.java diff --git a/make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java b/make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java index 8743efcb5ac..4eb0e0ace8e 100644 --- a/make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java +++ b/make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java @@ -37,6 +37,7 @@ import java.util.ResourceBundle.Control; import java.util.logging.Level; import java.util.logging.Logger; import java.util.stream.Collectors; +import java.util.stream.IntStream; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import org.xml.sax.SAXNotRecognizedException; @@ -52,21 +53,32 @@ public class CLDRConverter { static final String LDML_DTD_SYSTEM_ID = "http://www.unicode.org/cldr/dtd/2.0/ldml.dtd"; static final String SPPL_LDML_DTD_SYSTEM_ID = "http://www.unicode.org/cldr/dtd/2.0/ldmlSupplemental.dtd"; + static final String BCP47_LDML_DTD_SYSTEM_ID = "http://www.unicode.org/cldr/dtd/2.0/ldmlBCP47.dtd"; + private static String CLDR_BASE = "../CLDR/21.0.1/"; static String LOCAL_LDML_DTD; static String LOCAL_SPPL_LDML_DTD; + static String LOCAL_BCP47_LDML_DTD; private static String SOURCE_FILE_DIR; private static String SPPL_SOURCE_FILE; private static String NUMBERING_SOURCE_FILE; private static String METAZONES_SOURCE_FILE; private static String LIKELYSUBTAGS_SOURCE_FILE; + private static String TIMEZONE_SOURCE_FILE; static String DESTINATION_DIR = "build/gensrc"; static final String LOCALE_NAME_PREFIX = "locale.displayname."; + static final String LOCALE_SEPARATOR = LOCALE_NAME_PREFIX + "separator"; + static final String LOCALE_KEYTYPE = LOCALE_NAME_PREFIX + "keytype"; + static final String LOCALE_KEY_PREFIX = LOCALE_NAME_PREFIX + "key."; + static final String LOCALE_TYPE_PREFIX = LOCALE_NAME_PREFIX + "type."; + static final String LOCALE_TYPE_PREFIX_CA = LOCALE_TYPE_PREFIX + "ca."; static final String CURRENCY_SYMBOL_PREFIX = "currency.symbol."; static final String CURRENCY_NAME_PREFIX = "currency.displayname."; static final String CALENDAR_NAME_PREFIX = "calendarname."; + static final String CALENDAR_FIRSTDAY_PREFIX = "firstDay."; + static final String CALENDAR_MINDAYS_PREFIX = "minDays."; static final String TIMEZONE_ID_PREFIX = "timezone.id."; static final String ZONE_NAME_PREFIX = "timezone.displayname."; static final String METAZONE_ID_PREFIX = "metazone.id."; @@ -76,6 +88,7 @@ public class CLDRConverter { private static LikelySubtagsParseHandler handlerLikelySubtags; static NumberingSystemsParseHandler handlerNumbering; static MetaZonesParseHandler handlerMetaZones; + static TimeZoneParseHandler handlerTimeZone; private static BundleGenerator bundleGenerator; // java.base module related @@ -201,11 +214,13 @@ public class CLDRConverter { // Set up path names LOCAL_LDML_DTD = CLDR_BASE + "/dtd/ldml.dtd"; LOCAL_SPPL_LDML_DTD = CLDR_BASE + "/dtd/ldmlSupplemental.dtd"; + LOCAL_BCP47_LDML_DTD = CLDR_BASE + "/dtd/ldmlBCP47.dtd"; SOURCE_FILE_DIR = CLDR_BASE + "/main"; SPPL_SOURCE_FILE = CLDR_BASE + "/supplemental/supplementalData.xml"; LIKELYSUBTAGS_SOURCE_FILE = CLDR_BASE + "/supplemental/likelySubtags.xml"; NUMBERING_SOURCE_FILE = CLDR_BASE + "/supplemental/numberingSystems.xml"; METAZONES_SOURCE_FILE = CLDR_BASE + "/supplemental/metaZones.xml"; + TIMEZONE_SOURCE_FILE = CLDR_BASE + "/bcp47/timezone.xml"; if (BASE_LOCALES.isEmpty()) { setupBaseLocales("en-US"); @@ -215,10 +230,10 @@ public class CLDRConverter { // Parse data independent of locales parseSupplemental(); + parseBCP47(); List bundles = readBundleList(); convertBundles(bundles); - convertBundles(addedBundles); } private static void usage() { @@ -314,34 +329,19 @@ public class CLDRConverter { } private static final Map> cldrBundles = new HashMap<>(); - // this list will contain additional bundles to be generated for Region dependent Data. - private static List addedBundles = new ArrayList<>(); private static Map> metaInfo = new HashMap<>(); static { // For generating information on supported locales. - metaInfo.put("LocaleNames", new TreeSet<>()); - metaInfo.put("CurrencyNames", new TreeSet<>()); - metaInfo.put("TimeZoneNames", new TreeSet<>()); - metaInfo.put("CalendarData", new TreeSet<>()); - metaInfo.put("FormatData", new TreeSet<>()); metaInfo.put("AvailableLocales", new TreeSet<>()); } - - private static Set calendarDataFields = Set.of("firstDayOfWeek", "minimalDaysInFirstWeek"); - static Map getCLDRBundle(String id) throws Exception { Map bundle = cldrBundles.get(id); if (bundle != null) { return bundle; } - SAXParserFactory factory = SAXParserFactory.newInstance(); - factory.setValidating(true); - SAXParser parser = factory.newSAXParser(); - enableFileAccess(parser); - LDMLParseHandler handler = new LDMLParseHandler(id); File file = new File(SOURCE_FILE_DIR + File.separator + id + ".xml"); if (!file.exists()) { // Skip if the file doesn't exist. @@ -349,14 +349,15 @@ public class CLDRConverter { } info("..... main directory ....."); - info("Reading file " + file); - parser.parse(file, handler); + LDMLParseHandler handler = new LDMLParseHandler(id); + parseLDMLFile(file, handler); bundle = handler.getData(); cldrBundles.put(id, bundle); - String country = getCountryCode(id); - if (country != null) { - bundle = handlerSuppl.getData(country); + + if (id.equals("root")) { + // Calendar data (firstDayOfWeek & minDaysInFirstWeek) + bundle = handlerSuppl.getData("root"); if (bundle != null) { //merge two maps into one map Map temp = cldrBundles.remove(id); @@ -379,98 +380,44 @@ public class CLDRConverter { // SupplementalData file also provides the "parent" locales which // are othrwise not to be fallen back. Process them here as well. // - info("..... Parsing supplementalData.xml ....."); - SAXParserFactory factorySuppl = SAXParserFactory.newInstance(); - factorySuppl.setValidating(true); - SAXParser parserSuppl = factorySuppl.newSAXParser(); - enableFileAccess(parserSuppl); handlerSuppl = new SupplementDataParseHandler(); - File fileSupply = new File(SPPL_SOURCE_FILE); - parserSuppl.parse(fileSupply, handlerSuppl); + parseLDMLFile(new File(SPPL_SOURCE_FILE), handlerSuppl); Map parentData = handlerSuppl.getData("root"); - parentData.keySet().forEach(key -> { + parentData.keySet().stream() + .filter(key -> key.startsWith(PARENT_LOCALE_PREFIX)) + .forEach(key -> { parentLocalesMap.put(key, new TreeSet( Arrays.asList(((String)parentData.get(key)).split(" ")))); }); // Parse numberingSystems to get digit zero character information. - SAXParserFactory numberingParser = SAXParserFactory.newInstance(); - numberingParser.setValidating(true); - SAXParser parserNumbering = numberingParser.newSAXParser(); - enableFileAccess(parserNumbering); handlerNumbering = new NumberingSystemsParseHandler(); - File fileNumbering = new File(NUMBERING_SOURCE_FILE); - parserNumbering.parse(fileNumbering, handlerNumbering); + parseLDMLFile(new File(NUMBERING_SOURCE_FILE), handlerNumbering); // Parse metaZones to create mappings between Olson tzids and CLDR meta zone names - info("..... Parsing metaZones.xml ....."); - SAXParserFactory metazonesParser = SAXParserFactory.newInstance(); - metazonesParser.setValidating(true); - SAXParser parserMetaZones = metazonesParser.newSAXParser(); - enableFileAccess(parserMetaZones); handlerMetaZones = new MetaZonesParseHandler(); - File fileMetaZones = new File(METAZONES_SOURCE_FILE); - parserMetaZones.parse(fileMetaZones, handlerMetaZones); + parseLDMLFile(new File(METAZONES_SOURCE_FILE), handlerMetaZones); // Parse likelySubtags - info("..... Parsing likelySubtags.xml ....."); - SAXParserFactory likelySubtagsParser = SAXParserFactory.newInstance(); - likelySubtagsParser.setValidating(true); - SAXParser parserLikelySubtags = likelySubtagsParser.newSAXParser(); - enableFileAccess(parserLikelySubtags); handlerLikelySubtags = new LikelySubtagsParseHandler(); - File fileLikelySubtags = new File(LIKELYSUBTAGS_SOURCE_FILE); - parserLikelySubtags.parse(fileLikelySubtags, handlerLikelySubtags); + parseLDMLFile(new File(LIKELYSUBTAGS_SOURCE_FILE), handlerLikelySubtags); } - /** - * This method will check if a new region dependent Bundle needs to be - * generated for this Locale id and targetMap. New Bundle will be generated - * when Locale id has non empty script and country code and targetMap - * contains region dependent data. This method will also remove region - * dependent data from this targetMap after candidate locales check. E.g. It - * will call genRegionDependentBundle() in case of az_Latn_AZ locale and - * remove region dependent data from this targetMap so that az_Latn_AZ - * bundle will not be created. For az_Cyrl_AZ, new Bundle will be generated - * but region dependent data will not be removed from targetMap as its candidate - * locales are [az_Cyrl_AZ, az_Cyrl, root], which does not include az_AZ for - * fallback. - * - */ - - private static void checkRegionDependentBundle(Map targetMap, String id) { - if ((CLDRConverter.getScript(id) != "") - && (CLDRConverter.getCountryCode(id) != "")) { - Map regionDepDataMap = targetMap - .keySet() - .stream() - .filter(calendarDataFields::contains) - .collect(Collectors.toMap(k -> k, targetMap::get)); - if (!regionDepDataMap.isEmpty()) { - Locale cldrLoc = new Locale(CLDRConverter.getLanguageCode(id), - CLDRConverter.getCountryCode(id)); - genRegionDependentBundle(regionDepDataMap, cldrLoc); - if (checkCandidateLocales(id, cldrLoc)) { - // Remove matchedKeys from this targetMap only if checkCandidateLocales() returns true. - regionDepDataMap.keySet().forEach(targetMap::remove); - } - } - } + // Parsers for data in "bcp47" directory + // + private static void parseBCP47() throws Exception { + // Parse timezone + handlerTimeZone = new TimeZoneParseHandler(); + parseLDMLFile(new File(TIMEZONE_SOURCE_FILE), handlerTimeZone); } - /** - * This method will generate a new Bundle for region dependent data, - * minimalDaysInFirstWeek and firstDayOfWeek. Newly generated Bundle will be added - * to addedBundles list. - */ - private static void genRegionDependentBundle(Map targetMap, Locale cldrLoc) { - String localeId = cldrLoc.toString(); - StringBuilder sb = getCandLocales(cldrLoc); - if (sb.indexOf(localeId) == -1) { - sb.append(localeId); - } - Bundle bundle = new Bundle(localeId, sb.toString(), null, null); - cldrBundles.put(localeId, targetMap); - addedBundles.add(bundle); + + private static void parseLDMLFile(File srcfile, AbstractLDMLHandler handler) throws Exception { + info("..... Parsing " + srcfile.getName() + " ....."); + SAXParserFactory pf = SAXParserFactory.newInstance(); + pf.setValidating(true); + SAXParser parser = pf.newSAXParser(); + enableFileAccess(parser); + parser.parse(srcfile, handler); } private static StringBuilder getCandLocales(Locale cldrLoc) { @@ -491,16 +438,6 @@ public class CLDRConverter { return candList; } - /** - * This method will return true, if for a given locale, its language and - * country specific locale will exist in runtime lookup path. E.g. it will - * return true for bs_Latn_BA. - */ - private static boolean checkCandidateLocales(String id, Locale cldrLoc) { - return(getCandidateLocales(Locale.forLanguageTag(id.replaceAll("_", "-"))) - .contains(cldrLoc)); - } - private static void convertBundles(List bundles) throws Exception { // parent locales map. The mappings are put in base metaInfo file // for now. @@ -514,8 +451,6 @@ public class CLDRConverter { Map targetMap = bundle.getTargetMap(); - // check if new region DependentBundle needs to be generated for this Locale. - checkRegionDependentBundle(targetMap, bundle.getID()); EnumSet bundleTypes = bundle.getBundleTypes(); if (bundle.isRoot()) { @@ -528,40 +463,30 @@ public class CLDRConverter { if (bundleTypes.contains(Bundle.Type.LOCALENAMES)) { Map localeNamesMap = extractLocaleNames(targetMap, bundle.getID()); if (!localeNamesMap.isEmpty() || bundle.isRoot()) { - metaInfo.get("LocaleNames").add(toLanguageTag(bundle.getID())); - addLikelySubtags(metaInfo, "LocaleNames", bundle.getID()); bundleGenerator.generateBundle("util", "LocaleNames", bundle.getJavaID(), true, localeNamesMap, BundleType.OPEN); } } if (bundleTypes.contains(Bundle.Type.CURRENCYNAMES)) { Map currencyNamesMap = extractCurrencyNames(targetMap, bundle.getID(), bundle.getCurrencies()); if (!currencyNamesMap.isEmpty() || bundle.isRoot()) { - metaInfo.get("CurrencyNames").add(toLanguageTag(bundle.getID())); - addLikelySubtags(metaInfo, "CurrencyNames", bundle.getID()); bundleGenerator.generateBundle("util", "CurrencyNames", bundle.getJavaID(), true, currencyNamesMap, BundleType.OPEN); } } if (bundleTypes.contains(Bundle.Type.TIMEZONENAMES)) { Map zoneNamesMap = extractZoneNames(targetMap, bundle.getID()); if (!zoneNamesMap.isEmpty() || bundle.isRoot()) { - metaInfo.get("TimeZoneNames").add(toLanguageTag(bundle.getID())); - addLikelySubtags(metaInfo, "TimeZoneNames", bundle.getID()); bundleGenerator.generateBundle("util", "TimeZoneNames", bundle.getJavaID(), true, zoneNamesMap, BundleType.TIMEZONE); } } if (bundleTypes.contains(Bundle.Type.CALENDARDATA)) { Map calendarDataMap = extractCalendarData(targetMap, bundle.getID()); if (!calendarDataMap.isEmpty() || bundle.isRoot()) { - metaInfo.get("CalendarData").add(toLanguageTag(bundle.getID())); - addLikelySubtags(metaInfo, "CalendarData", bundle.getID()); bundleGenerator.generateBundle("util", "CalendarData", bundle.getJavaID(), true, calendarDataMap, BundleType.PLAIN); } } if (bundleTypes.contains(Bundle.Type.FORMATDATA)) { Map formatDataMap = extractFormatData(targetMap, bundle.getID()); if (!formatDataMap.isEmpty() || bundle.isRoot()) { - metaInfo.get("FormatData").add(toLanguageTag(bundle.getID())); - addLikelySubtags(metaInfo, "FormatData", bundle.getID()); bundleGenerator.generateBundle("text", "FormatData", bundle.getJavaID(), true, formatDataMap, BundleType.PLAIN); } } @@ -570,43 +495,9 @@ public class CLDRConverter { metaInfo.get("AvailableLocales").add(toLanguageTag(bundle.getID())); addLikelySubtags(metaInfo, "AvailableLocales", bundle.getID()); } - addCldrImplicitLocales(metaInfo); bundleGenerator.generateMetaInfo(metaInfo); } - /** - * These are the Locales that are implicitly supported by CLDR. - * Adding them explicitly as likelySubtags here, will ensure that - * COMPAT locales do not precede them during ResourceBundle search path. - */ - private static void addCldrImplicitLocales(Map> metaInfo) { - metaInfo.get("LocaleNames").add("zh-Hans-CN"); - metaInfo.get("LocaleNames").add("zh-Hans-SG"); - metaInfo.get("LocaleNames").add("zh-Hant-HK"); - metaInfo.get("LocaleNames").add("zh-Hant-MO"); - metaInfo.get("LocaleNames").add("zh-Hant-TW"); - metaInfo.get("CurrencyNames").add("zh-Hans-CN"); - metaInfo.get("CurrencyNames").add("zh-Hans-SG"); - metaInfo.get("CurrencyNames").add("zh-Hant-HK"); - metaInfo.get("CurrencyNames").add("zh-Hant-MO"); - metaInfo.get("CurrencyNames").add("zh-Hant-TW"); - metaInfo.get("TimeZoneNames").add("zh-Hans-CN"); - metaInfo.get("TimeZoneNames").add("zh-Hans-SG"); - metaInfo.get("TimeZoneNames").add("zh-Hant-HK"); - metaInfo.get("TimeZoneNames").add("zh-Hant-MO"); - metaInfo.get("TimeZoneNames").add("zh-Hant-TW"); - metaInfo.get("TimeZoneNames").add("zh-HK"); - metaInfo.get("CalendarData").add("zh-Hans-CN"); - metaInfo.get("CalendarData").add("zh-Hans-SG"); - metaInfo.get("CalendarData").add("zh-Hant-HK"); - metaInfo.get("CalendarData").add("zh-Hant-MO"); - metaInfo.get("CalendarData").add("zh-Hant-TW"); - metaInfo.get("FormatData").add("zh-Hans-CN"); - metaInfo.get("FormatData").add("zh-Hans-SG"); - metaInfo.get("FormatData").add("zh-Hant-HK"); - metaInfo.get("FormatData").add("zh-Hant-MO"); - metaInfo.get("FormatData").add("zh-Hant-TW"); - } static final Map aliases = new HashMap<>(); /** @@ -656,14 +547,6 @@ public class CLDRConverter { return Locale.forLanguageTag(id.replaceAll("_", "-")).getCountry(); } - /* - * Returns the script portion of the given id. - * If id is "root", "" is returned. - */ - static String getScript(String id) { - return "root".equals(id) ? "" : Locale.forLanguageTag(id.replaceAll("_", "-")).getScript(); - } - private static class KeyComparator implements Comparator { static KeyComparator INSTANCE = new KeyComparator(); @@ -695,9 +578,25 @@ public class CLDRConverter { Map localeNames = new TreeMap<>(KeyComparator.INSTANCE); for (String key : map.keySet()) { if (key.startsWith(LOCALE_NAME_PREFIX)) { - localeNames.put(key.substring(LOCALE_NAME_PREFIX.length()), map.get(key)); + switch (key) { + case LOCALE_SEPARATOR: + localeNames.put("ListCompositionPattern", map.get(key)); + break; + case LOCALE_KEYTYPE: + localeNames.put("ListKeyTypePattern", map.get(key)); + break; + default: + localeNames.put(key.substring(LOCALE_NAME_PREFIX.length()), map.get(key)); + break; + } } } + + if (id.equals("root")) { + // Add display name pattern, which is not in CLDR + localeNames.put("DisplayNamePattern", "{0,choice,0#|1#{1}|2#{1} ({2})}"); + } + return localeNames; } @@ -778,10 +677,30 @@ public class CLDRConverter { return names; } + /** + * Extracts the language independent calendar data. Each of the two keys, + * "firstDayOfWeek" and "minimalDaysInFirstWeek" has a string value consists of + * one or multiple occurrences of: + * i: rg1 rg2 ... rgn; + * where "i" is the data for the following regions (delimited by a space) after + * ":", and ends with a ";". + */ private static Map extractCalendarData(Map map, String id) { Map calendarData = new LinkedHashMap<>(); - copyIfPresent(map, "firstDayOfWeek", calendarData); - copyIfPresent(map, "minimalDaysInFirstWeek", calendarData); + if (id.equals("root")) { + calendarData.put("firstDayOfWeek", + IntStream.range(1, 8) + .mapToObj(String::valueOf) + .filter(d -> map.keySet().contains(CALENDAR_FIRSTDAY_PREFIX + d)) + .map(d -> d + ": " + map.get(CALENDAR_FIRSTDAY_PREFIX + d)) + .collect(Collectors.joining(";"))); + calendarData.put("minimalDaysInFirstWeek", + IntStream.range(0, 7) + .mapToObj(String::valueOf) + .filter(d -> map.keySet().contains(CALENDAR_MINDAYS_PREFIX + d)) + .map(d -> d + ": " + map.get(CALENDAR_MINDAYS_PREFIX + d)) + .collect(Collectors.joining(";"))); + } return calendarData; } @@ -844,17 +763,19 @@ public class CLDRConverter { for (String key : map.keySet()) { // Copy available calendar names - if (key.startsWith(CLDRConverter.CALENDAR_NAME_PREFIX)) { - String type = key.substring(CLDRConverter.CALENDAR_NAME_PREFIX.length()); + if (key.startsWith(CLDRConverter.LOCALE_TYPE_PREFIX_CA)) { + String type = key.substring(CLDRConverter.LOCALE_TYPE_PREFIX_CA.length()); for (CalendarType calendarType : CalendarType.values()) { if (calendarType == CalendarType.GENERIC) { continue; } if (type.equals(calendarType.lname())) { Object value = map.get(key); - formatData.put(key, value); - String ukey = CLDRConverter.CALENDAR_NAME_PREFIX + calendarType.uname(); - if (!key.equals(ukey)) { + String dataKey = key.replace(LOCALE_TYPE_PREFIX_CA, + CALENDAR_NAME_PREFIX); + formatData.put(dataKey, value); + String ukey = CALENDAR_NAME_PREFIX + calendarType.uname(); + if (!dataKey.equals(ukey)) { formatData.put(ukey, value); } } @@ -874,6 +795,18 @@ public class CLDRConverter { copyIfPresent(map, "NumberElements", formatData); } copyIfPresent(map, "NumberPatterns", formatData); + + // put extra number elements for available scripts into formatData, if it is "root" + if (id.equals("root")) { + handlerNumbering.keySet().stream() + .filter(k -> !numberingScripts.contains(k)) + .forEach(k -> { + String[] ne = (String[])map.get("latn.NumberElements"); + String[] neNew = Arrays.copyOf(ne, ne.length); + neNew[4] = handlerNumbering.get(k).substring(0, 1); + formatData.put(k + ".NumberElements", neNew); + }); + } return formatData; } diff --git a/make/jdk/src/classes/build/tools/cldrconverter/LDMLParseHandler.java b/make/jdk/src/classes/build/tools/cldrconverter/LDMLParseHandler.java index b229c91731f..34cf8a2d4d3 100644 --- a/make/jdk/src/classes/build/tools/cldrconverter/LDMLParseHandler.java +++ b/make/jdk/src/classes/build/tools/cldrconverter/LDMLParseHandler.java @@ -76,12 +76,16 @@ class LDMLParseHandler extends AbstractLDMLHandler { // ignore this element - it has language and territory elements that aren't locale data pushIgnoredContainer(qName); break; - case "type": - if ("calendar".equals(attributes.getValue("key"))) { - pushStringEntry(qName, attributes, CLDRConverter.CALENDAR_NAME_PREFIX + attributes.getValue("type")); - } else { - pushIgnoredContainer(qName); - } + + // for LocaleNames + // copy string + case "localeSeparator": + pushStringEntry(qName, attributes, + CLDRConverter.LOCALE_SEPARATOR); + break; + case "localeKeyTypePattern": + pushStringEntry(qName, attributes, + CLDRConverter.LOCALE_KEYTYPE); break; case "language": @@ -96,6 +100,24 @@ class LDMLParseHandler extends AbstractLDMLHandler { attributes.getValue("type")); break; + case "key": + // for LocaleNames + // copy string + pushStringEntry(qName, attributes, + CLDRConverter.LOCALE_KEY_PREFIX + + convertOldKeyName(attributes.getValue("type"))); + break; + + case "type": + // for LocaleNames/CalendarNames + // copy string + pushStringEntry(qName, attributes, + CLDRConverter.LOCALE_TYPE_PREFIX + + convertOldKeyName(attributes.getValue("key")) + "." + + attributes.getValue("type")); + + break; + // // Currency information // @@ -515,26 +537,10 @@ class LDMLParseHandler extends AbstractLDMLHandler { currentNumberingSystem = script + "."; String digits = CLDRConverter.handlerNumbering.get(script); if (digits == null) { - throw new InternalError("null digits for " + script); - } - if (Character.isSurrogate(digits.charAt(0))) { - // DecimalFormatSymbols doesn't support supplementary characters as digit zero. pushIgnoredContainer(qName); break; } - // in case digits are in the reversed order, reverse back the order. - if (digits.charAt(0) > digits.charAt(digits.length() - 1)) { - StringBuilder sb = new StringBuilder(digits); - digits = sb.reverse().toString(); - } - // Check if the order is sequential. - char c0 = digits.charAt(0); - for (int i = 1; i < digits.length(); i++) { - if (digits.charAt(i) != c0 + i) { - pushIgnoredContainer(qName); - break symbols; - } - } + @SuppressWarnings("unchecked") List numberingScripts = (List) get("numberingScripts"); if (numberingScripts == null) { @@ -924,17 +930,35 @@ class LDMLParseHandler extends AbstractLDMLHandler { } } } else if (currentContainer instanceof Entry) { - Entry entry = (Entry) currentContainer; - Object value = entry.getValue(); - if (value != null) { - String key = entry.getKey(); - // Tweak for MonthNames for the root locale, Needed for - // SimpleDateFormat.format()/parse() roundtrip. - if (id.equals("root") && key.startsWith("MonthNames")) { - value = new DateFormatSymbols(Locale.US).getShortMonths(); - } - put(entry.getKey(), value); + Entry entry = (Entry) currentContainer; + Object value = entry.getValue(); + if (value != null) { + String key = entry.getKey(); + // Tweak for MonthNames for the root locale, Needed for + // SimpleDateFormat.format()/parse() roundtrip. + if (id.equals("root") && key.startsWith("MonthNames")) { + value = new DateFormatSymbols(Locale.US).getShortMonths(); } + put(entry.getKey(), value); } } } + + public String convertOldKeyName(String key) { + // Explicitly obtained from "alias" attribute in each "key" element. + switch (key) { + case "calendar": + return "ca"; + case "currency": + return "cu"; + case "collation": + return "co"; + case "numbers": + return "nu"; + case "timezone": + return "tz"; + default: + return key; + } + } +} diff --git a/make/jdk/src/classes/build/tools/cldrconverter/NumberingSystemsParseHandler.java b/make/jdk/src/classes/build/tools/cldrconverter/NumberingSystemsParseHandler.java index 64f83d01e8b..11e43e49fc0 100644 --- a/make/jdk/src/classes/build/tools/cldrconverter/NumberingSystemsParseHandler.java +++ b/make/jdk/src/classes/build/tools/cldrconverter/NumberingSystemsParseHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,9 +54,32 @@ class NumberingSystemsParseHandler extends AbstractLDMLHandler { public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { switch (qName) { case "numberingSystem": - if ("numeric".equals(attributes.getValue("type"))) { - // eg, - put(attributes.getValue("id"), attributes.getValue("digits")); + numberingSystem: { + if ("numeric".equals(attributes.getValue("type"))) { + // eg, + String script = attributes.getValue("id"); + String digits = attributes.getValue("digits"); + + if (Character.isSurrogate(digits.charAt(0))) { + // DecimalFormatSymbols doesn't support supplementary characters as digit zero. + break numberingSystem; + } + // in case digits are in the reversed order, reverse back the order. + if (digits.charAt(0) > digits.charAt(digits.length() - 1)) { + StringBuilder sb = new StringBuilder(digits); + digits = sb.reverse().toString(); + } + // Check if the order is sequential. + char c0 = digits.charAt(0); + for (int i = 1; i < digits.length(); i++) { + if (digits.charAt(i) != c0 + i) { + break numberingSystem; + } + } + + // script/digits are acceptable. + put(script, digits); + } } pushIgnoredContainer(qName); break; diff --git a/make/jdk/src/classes/build/tools/cldrconverter/ResourceBundleGenerator.java b/make/jdk/src/classes/build/tools/cldrconverter/ResourceBundleGenerator.java index b291758402f..7a882e650f3 100644 --- a/make/jdk/src/classes/build/tools/cldrconverter/ResourceBundleGenerator.java +++ b/make/jdk/src/classes/build/tools/cldrconverter/ResourceBundleGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -256,20 +256,21 @@ class ResourceBundleGenerator implements BundleGenerator { CLDRConverter.info("Generating file " + file); try (PrintWriter out = new PrintWriter(file, "us-ascii")) { - out.println(CopyrightHeaders.getOpenJDKCopyright()); + out.printf(CopyrightHeaders.getOpenJDKCopyright()); - out.println((CLDRConverter.isBaseModule ? "package sun.util.cldr;\n\n" : + out.printf((CLDRConverter.isBaseModule ? "package sun.util.cldr;\n\n" : "package sun.util.resources.cldr.provider;\n\n") + "import java.util.HashMap;\n" + "import java.util.Locale;\n" + "import java.util.Map;\n" - + "import sun.util.locale.provider.LocaleProviderAdapter;\n" - + "import sun.util.locale.provider.LocaleDataMetaInfo;\n"); + + "import sun.util.locale.provider.LocaleDataMetaInfo;\n" + + "import sun.util.locale.provider.LocaleProviderAdapter;\n\n"); out.printf("public class %s implements LocaleDataMetaInfo {\n", className); - out.println(" private static final Map resourceNameToLocales = new HashMap<>();\n" + - (CLDRConverter.isBaseModule ? - " private static final Map parentLocalesMap = new HashMap<>();\n\n" : "\n") + - " static {\n"); + out.printf(" private static final Map resourceNameToLocales = new HashMap<>();\n" + + (CLDRConverter.isBaseModule ? + " private static final Map parentLocalesMap = new HashMap<>();\n\n" : + "\n") + + " static {\n"); for (String key : metaInfo.keySet()) { if (key.startsWith(CLDRConverter.PARENT_LOCALE_PREFIX)) { @@ -296,30 +297,50 @@ class ResourceBundleGenerator implements BundleGenerator { } out.printf("\n });\n"); } else { - out.printf(" resourceNameToLocales.put(\"%s\",\n", key); - out.printf(" \"%s\");\n", - toLocaleList(key.equals("FormatData") ? metaInfo.get("AvailableLocales") : - metaInfo.get(key), false)); + if ("AvailableLocales".equals(key)) { + out.printf(" resourceNameToLocales.put(\"%s\",\n", key); + out.printf(" \"%s\");\n", toLocaleList(metaInfo.get(key), false)); + } } } - out.println(" }\n\n"); - out.println(" @Override\n" + + out.printf(" }\n\n"); + + // end of static initializer block. + + // Short TZ names for delayed initialization + if (CLDRConverter.isBaseModule) { + out.printf(" private static class TZShortIDMapHolder {\n"); + out.printf(" static final Map tzShortIDMap = new HashMap<>();\n"); + out.printf(" static {\n"); + CLDRConverter.handlerTimeZone.getData().entrySet().stream() + .forEach(e -> { + out.printf(" tzShortIDMap.put(\"%s\", \"%s\");\n", e.getKey(), + ((String)e.getValue())); + }); + out.printf(" }\n }\n\n"); + } + + out.printf(" @Override\n" + " public LocaleProviderAdapter.Type getType() {\n" + " return LocaleProviderAdapter.Type.CLDR;\n" + " }\n\n"); - out.println(" @Override\n" + + out.printf(" @Override\n" + " public String availableLanguageTags(String category) {\n" + " return resourceNameToLocales.getOrDefault(category, \"\");\n" + " }\n\n"); if (CLDRConverter.isBaseModule) { + out.printf(" @Override\n" + + " public Map tzShortIDs() {\n" + + " return TZShortIDMapHolder.tzShortIDMap;\n" + + " }\n\n"); out.printf(" public Map parentLocales() {\n" + " return parentLocalesMap;\n" + " }\n}"); } else { - out.println("}"); + out.printf("}"); } } } diff --git a/make/jdk/src/classes/build/tools/cldrconverter/SupplementDataParseHandler.java b/make/jdk/src/classes/build/tools/cldrconverter/SupplementDataParseHandler.java index c5941d35e95..fdc8a977766 100644 --- a/make/jdk/src/classes/build/tools/cldrconverter/SupplementDataParseHandler.java +++ b/make/jdk/src/classes/build/tools/cldrconverter/SupplementDataParseHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -84,53 +84,18 @@ class SupplementDataParseHandler extends AbstractLDMLHandler { values.put(CLDRConverter.PARENT_LOCALE_PREFIX+key, parentLocalesMap.get(key)); }); - } else { - String countryData = getWeekData(id, JAVA_FIRSTDAY, firstDayMap); - if (countryData != null) { - values.put(JAVA_FIRSTDAY, countryData); - } - String minDaysData = getWeekData(id, JAVA_MINDAY, minDaysMap); - if (minDaysData != null) { - values.put(JAVA_MINDAY, minDaysData); - } + firstDayMap.keySet().forEach(key -> { + values.put(CLDRConverter.CALENDAR_FIRSTDAY_PREFIX+firstDayMap.get(key), + key); + }); + minDaysMap.keySet().forEach(key -> { + values.put(CLDRConverter.CALENDAR_MINDAYS_PREFIX+minDaysMap.get(key), + key); + }); } return values.isEmpty() ? null : values; } - /** - * It returns either firstDay or minDays in the JRE format for the country. - * - * @param country territory code of the requested data - * @param jreDataName JAVA_FIRSTDAY or JAVA_MINDAY - * @param dataMap firstDayMap or minDaysMap - * @return the value for the given jreDataName, or null if requested value - * (firstDay/minDays) is not available although that is highly unlikely - * because of the default value for the world (001). - */ - String getWeekData(String country, final String jreDataName, final Map dataMap) { - String countryValue = null; - String defaultWorldValue = null; - for (String key : dataMap.keySet()) { - if (key.contains(country)) { - if (jreDataName.equals(JAVA_FIRSTDAY)) { - countryValue = DAY_OF_WEEK_MAP.get((String) dataMap.get(key)); - } else if (jreDataName.equals(JAVA_MINDAY)) { - countryValue = (String) dataMap.get(key); - } - if (countryValue != null) { - return countryValue; - } - } else if (key.contains(WORLD)) { - if (jreDataName.equals(JAVA_FIRSTDAY)) { - defaultWorldValue = DAY_OF_WEEK_MAP.get((String) dataMap.get(key)); - } else if (jreDataName.equals(JAVA_MINDAY)) { - defaultWorldValue = (String) dataMap.get(key); - } - } - } - return defaultWorldValue; - } - @Override public InputSource resolveEntity(String publicID, String systemID) throws IOException, SAXException { // avoid HTTP traffic to unicode.org @@ -152,7 +117,33 @@ class SupplementDataParseHandler extends AbstractLDMLHandler { switch (qName) { case "firstDay": if (!isIgnored(attributes)) { - firstDayMap.put(attributes.getValue("territories"), attributes.getValue("day")); + String fd; + + switch (attributes.getValue("day")) { + case "sun": + fd = "1"; + break; + default: + case "mon": + fd = "2"; + break; + case "tue": + fd = "3"; + break; + case "wed": + fd = "4"; + break; + case "thu": + fd = "5"; + break; + case "fri": + fd = "6"; + break; + case "sat": + fd = "7"; + break; + } + firstDayMap.put(attributes.getValue("territories"), fd); } break; case "minDays": diff --git a/make/jdk/src/classes/build/tools/cldrconverter/TimeZoneParseHandler.java b/make/jdk/src/classes/build/tools/cldrconverter/TimeZoneParseHandler.java new file mode 100644 index 00000000000..ad0bd2ebd69 --- /dev/null +++ b/make/jdk/src/classes/build/tools/cldrconverter/TimeZoneParseHandler.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package build.tools.cldrconverter; + +import java.io.File; +import java.io.IOException; +import org.xml.sax.Attributes; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +/** + * Handles parsing of timezone.xml and produces a map from short timezone IDs to + * tz database IDs. + */ + +class TimeZoneParseHandler extends AbstractLDMLHandler { + + @Override + public InputSource resolveEntity(String publicID, String systemID) throws IOException, SAXException { + // avoid HTTP traffic to unicode.org + if (systemID.startsWith(CLDRConverter.BCP47_LDML_DTD_SYSTEM_ID)) { + return new InputSource((new File(CLDRConverter.LOCAL_BCP47_LDML_DTD)).toURI().toString()); + } + return null; + } + + @Override + public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { + switch (qName) { + case "type": + if (!isIgnored(attributes) && !attributes.getValue("deprecated").equals("true")) { + put(attributes.getValue("name"), attributes.getValue("alias")); + } + break; + default: + // treat anything else as a container + pushContainer(qName, attributes); + break; + } + } +} diff --git a/src/java.base/share/classes/java/text/DateFormat.java b/src/java.base/share/classes/java/text/DateFormat.java index a6bfe3232ec..2ee443c6638 100644 --- a/src/java.base/share/classes/java/text/DateFormat.java +++ b/src/java.base/share/classes/java/text/DateFormat.java @@ -97,6 +97,13 @@ import sun.util.locale.provider.LocaleServiceProviderPool; * DateFormat df = DateFormat.getDateInstance(DateFormat.LONG, Locale.FRANCE); * } * + * + *

If the specified locale contains "ca" (calendar), "rg" (region override), + * and/or "tz" (timezone) Unicode + * extensions, the calendar, the country and/or the time zone for formatting + * are overridden. If both "ca" and "rg" are specified, the calendar from the "ca" + * extension supersedes the implicit one from the "rg" extension. + * *

You can use a DateFormat to parse also. *

*
{@code
diff --git a/src/java.base/share/classes/java/text/DateFormatSymbols.java b/src/java.base/share/classes/java/text/DateFormatSymbols.java
index 724c1e71ac3..774b64ca1b5 100644
--- a/src/java.base/share/classes/java/text/DateFormatSymbols.java
+++ b/src/java.base/share/classes/java/text/DateFormatSymbols.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,6 +49,7 @@ import java.util.Objects;
 import java.util.ResourceBundle;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
+import sun.util.locale.provider.CalendarDataUtility;
 import sun.util.locale.provider.LocaleProviderAdapter;
 import sun.util.locale.provider.LocaleServiceProviderPool;
 import sun.util.locale.provider.ResourceBundleBasedAdapter;
@@ -82,6 +83,10 @@ import sun.util.locale.provider.TimeZoneNameUtility;
  * 
*
* + *

If the locale contains "rg" (region override) + * Unicode extension, + * the symbols are overridden for the designated region. + * *

* DateFormatSymbols objects are cloneable. When you obtain * a DateFormatSymbols object, feel free to modify the @@ -716,15 +721,18 @@ public class DateFormatSymbols implements Serializable, Cloneable { } dfs = new DateFormatSymbols(false); + // check for region override + Locale override = CalendarDataUtility.findRegionOverride(locale); + // Initialize the fields from the ResourceBundle for locale. LocaleProviderAdapter adapter - = LocaleProviderAdapter.getAdapter(DateFormatSymbolsProvider.class, locale); + = LocaleProviderAdapter.getAdapter(DateFormatSymbolsProvider.class, override); // Avoid any potential recursions if (!(adapter instanceof ResourceBundleBasedAdapter)) { adapter = LocaleProviderAdapter.getResourceBundleBased(); } ResourceBundle resource - = ((ResourceBundleBasedAdapter)adapter).getLocaleData().getDateFormatData(locale); + = ((ResourceBundleBasedAdapter)adapter).getLocaleData().getDateFormatData(override); dfs.locale = locale; // JRE and CLDR use different keys diff --git a/src/java.base/share/classes/java/text/DecimalFormatSymbols.java b/src/java.base/share/classes/java/text/DecimalFormatSymbols.java index 989d6f26377..59e68600589 100644 --- a/src/java.base/share/classes/java/text/DecimalFormatSymbols.java +++ b/src/java.base/share/classes/java/text/DecimalFormatSymbols.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,6 +44,7 @@ import java.io.Serializable; import java.text.spi.DecimalFormatSymbolsProvider; import java.util.Currency; import java.util.Locale; +import sun.util.locale.provider.CalendarDataUtility; import sun.util.locale.provider.LocaleProviderAdapter; import sun.util.locale.provider.LocaleServiceProviderPool; import sun.util.locale.provider.ResourceBundleBasedAdapter; @@ -56,6 +57,10 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; * of these symbols, you can get the DecimalFormatSymbols object from * your DecimalFormat and modify it. * + *

If the locale contains "rg" (region override) + * Unicode extension, + * the symbols are overridden for the designated region. + * * @see java.util.Locale * @see DecimalFormat * @author Mark Davis @@ -609,13 +614,18 @@ public class DecimalFormatSymbols implements Cloneable, Serializable { private void initialize( Locale locale ) { this.locale = locale; + // check for region override + Locale override = locale.getUnicodeLocaleType("nu") == null ? + CalendarDataUtility.findRegionOverride(locale) : + locale; + // get resource bundle data - LocaleProviderAdapter adapter = LocaleProviderAdapter.getAdapter(DecimalFormatSymbolsProvider.class, locale); + LocaleProviderAdapter adapter = LocaleProviderAdapter.getAdapter(DecimalFormatSymbolsProvider.class, override); // Avoid potential recursions if (!(adapter instanceof ResourceBundleBasedAdapter)) { adapter = LocaleProviderAdapter.getResourceBundleBased(); } - Object[] data = adapter.getLocaleResources(locale).getDecimalFormatSymbolsData(); + Object[] data = adapter.getLocaleResources(override).getDecimalFormatSymbolsData(); String[] numberElements = (String[]) data[0]; decimalSeparator = numberElements[0].charAt(0); diff --git a/src/java.base/share/classes/java/text/NumberFormat.java b/src/java.base/share/classes/java/text/NumberFormat.java index aab8eab226a..a1de3fe8f2f 100644 --- a/src/java.base/share/classes/java/text/NumberFormat.java +++ b/src/java.base/share/classes/java/text/NumberFormat.java @@ -96,7 +96,14 @@ import sun.util.locale.provider.LocaleServiceProviderPool; * NumberFormat nf = NumberFormat.getInstance(Locale.FRENCH); * } * - * You can also use a NumberFormat to parse numbers: + * + *

If the locale contains "nu" (numbers) and/or "rg" (region override) + * Unicode extensions, + * the decimal digits, and/or the country used for formatting are overridden. + * If both "nu" and "rg" are specified, the decimal digits from the "nu" + * extension supersedes the implicit one from the "rg" extension. + * + *

You can also use a {@code NumberFormat} to parse numbers: *

*
{@code
  * myNumber = nf.parse(myString);
diff --git a/src/java.base/share/classes/java/text/SimpleDateFormat.java b/src/java.base/share/classes/java/text/SimpleDateFormat.java
index eb070c68da5..0f36386cbbf 100644
--- a/src/java.base/share/classes/java/text/SimpleDateFormat.java
+++ b/src/java.base/share/classes/java/text/SimpleDateFormat.java
@@ -672,7 +672,7 @@ public class SimpleDateFormat extends DateFormat {
             // However, the calendar should use the current default TimeZone.
             // If this is not contained in the locale zone strings, then the zone
             // will be formatted using generic GMT+/-H:MM nomenclature.
-            calendar = Calendar.getInstance(TimeZone.getDefault(), loc);
+            calendar = Calendar.getInstance(loc);
         }
     }
 
diff --git a/src/java.base/share/classes/java/time/format/DateTimeFormatter.java b/src/java.base/share/classes/java/time/format/DateTimeFormatter.java
index c73d0bb0c26..199313df7e1 100644
--- a/src/java.base/share/classes/java/time/format/DateTimeFormatter.java
+++ b/src/java.base/share/classes/java/time/format/DateTimeFormatter.java
@@ -97,6 +97,7 @@ import java.util.Locale;
 import java.util.Map;
 import java.util.Objects;
 import java.util.Set;
+import sun.util.locale.provider.TimeZoneNameUtility;
 
 /**
  * Formatter for printing and parsing date-time objects.
@@ -548,7 +549,7 @@ public final class DateTimeFormatter {
      * For example, {@code d MMM uuuu} will format 2011-12-03 as '3 Dec 2011'.
      * 

* The formatter will use the {@link Locale#getDefault(Locale.Category) default FORMAT locale}. - * This can be changed using {@link DateTimeFormatter#withLocale(Locale)} on the returned formatter + * This can be changed using {@link DateTimeFormatter#withLocale(Locale)} on the returned formatter. * Alternatively use the {@link #ofPattern(String, Locale)} variant of this method. *

* The returned formatter has no override chronology or zone. @@ -572,7 +573,7 @@ public final class DateTimeFormatter { * For example, {@code d MMM uuuu} will format 2011-12-03 as '3 Dec 2011'. *

* The formatter will use the specified locale. - * This can be changed using {@link DateTimeFormatter#withLocale(Locale)} on the returned formatter + * This can be changed using {@link DateTimeFormatter#withLocale(Locale)} on the returned formatter. *

* The returned formatter has no override chronology or zone. * It uses {@link ResolverStyle#SMART SMART} resolver style. @@ -1443,10 +1444,17 @@ public final class DateTimeFormatter { * This is used to lookup any part of the formatter needing specific * localization, such as the text or localized pattern. *

+ * The locale is stored as passed in, without further processing. + * If the locale has + * Unicode extensions, they may be used later in text + * processing. To set the chronology, time-zone and decimal style from + * unicode extensions, see {@link #localizedBy localizedBy()}. + *

* This instance is immutable and unaffected by this method call. * * @param locale the new locale, not null * @return a formatter based on this formatter with the requested locale, not null + * @see #localizedBy(Locale) */ public DateTimeFormatter withLocale(Locale locale) { if (this.locale.equals(locale)) { @@ -1455,6 +1463,52 @@ public final class DateTimeFormatter { return new DateTimeFormatter(printerParser, locale, decimalStyle, resolverStyle, resolverFields, chrono, zone); } + /** + * Returns a copy of this formatter with localized values of the locale, + * calendar, region, decimal style and/or timezone, that supercede values in + * this formatter. + *

+ * This is used to lookup any part of the formatter needing specific + * localization, such as the text or localized pattern. If the locale contains the + * "ca" (calendar), "nu" (numbering system), "rg" (region override), and/or + * "tz" (timezone) + * Unicode extensions, + * the chronology, numbering system and/or the zone are overridden. If both "ca" + * and "rg" are specified, the chronology from the "ca" extension supersedes the + * implicit one from the "rg" extension. Same is true for the "nu" extension. + *

+ * Unlike the {@link #withLocale withLocale} method, the call to this method may + * produce a different formatter depending on the order of method chaining with + * other withXXXX() methods. + *

+ * This instance is immutable and unaffected by this method call. + * + * @param locale the locale, not null + * @return a formatter based on this formatter with localized values of + * the calendar, decimal style and/or timezone, that supercede values in this + * formatter. + * @see #withLocale(Locale) + * @since 10 + */ + public DateTimeFormatter localizedBy(Locale locale) { + if (this.locale.equals(locale)) { + return this; + } + + // Check for decimalStyle/chronology/timezone in locale object + Chronology c = locale.getUnicodeLocaleType("ca") != null ? + Chronology.ofLocale(locale) : chrono; + DecimalStyle ds = locale.getUnicodeLocaleType("nu") != null ? + DecimalStyle.of(locale) : decimalStyle; + String tzType = locale.getUnicodeLocaleType("tz"); + ZoneId z = tzType != null ? + TimeZoneNameUtility.convertLDMLShortID(tzType) + .map(ZoneId::of) + .orElse(zone) : + zone; + return new DateTimeFormatter(printerParser, locale, ds, resolverStyle, resolverFields, c, z); + } + //----------------------------------------------------------------------- /** * Gets the DecimalStyle to be used during formatting. diff --git a/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java b/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java index ebf044919a4..5735325f30f 100644 --- a/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java +++ b/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -120,6 +120,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import sun.text.spi.JavaTimeDateTimePatternProvider; +import sun.util.locale.provider.CalendarDataUtility; import sun.util.locale.provider.LocaleProviderAdapter; import sun.util.locale.provider.LocaleResources; import sun.util.locale.provider.TimeZoneNameUtility; @@ -198,6 +199,10 @@ public final class DateTimeFormatterBuilder { * Gets the formatting pattern for date and time styles for a locale and chronology. * The locale and chronology are used to lookup the locale specific format * for the requested dateStyle and/or timeStyle. + *

+ * If the locale contains the "rg" (region override) + * Unicode extensions, + * the formatting pattern is overridden with the one appropriate for the region. * * @param dateStyle the FormatStyle for the date, null for time-only pattern * @param timeStyle the FormatStyle for the time, null for date-only pattern @@ -216,7 +221,8 @@ public final class DateTimeFormatterBuilder { LocaleProviderAdapter adapter = LocaleProviderAdapter.getAdapter(JavaTimeDateTimePatternProvider.class, locale); JavaTimeDateTimePatternProvider provider = adapter.getJavaTimeDateTimePatternProvider(); String pattern = provider.getJavaTimeDateTimePattern(convertStyle(timeStyle), - convertStyle(dateStyle), chrono.getCalendarType(), locale); + convertStyle(dateStyle), chrono.getCalendarType(), + CalendarDataUtility.findRegionOverride(locale)); return pattern; } diff --git a/src/java.base/share/classes/java/time/format/DateTimeTextProvider.java b/src/java.base/share/classes/java/time/format/DateTimeTextProvider.java index d3fa2161f2b..1db9edb4275 100644 --- a/src/java.base/share/classes/java/time/format/DateTimeTextProvider.java +++ b/src/java.base/share/classes/java/time/format/DateTimeTextProvider.java @@ -510,7 +510,8 @@ class DateTimeTextProvider { @SuppressWarnings("unchecked") static T getLocalizedResource(String key, Locale locale) { LocaleResources lr = LocaleProviderAdapter.getResourceBundleBased() - .getLocaleResources(locale); + .getLocaleResources( + CalendarDataUtility.findRegionOverride(locale)); ResourceBundle rb = lr.getJavaTimeFormatData(); return rb.containsKey(key) ? (T) rb.getObject(key) : null; } diff --git a/src/java.base/share/classes/java/time/format/DecimalStyle.java b/src/java.base/share/classes/java/time/format/DecimalStyle.java index 197e47d96b8..73f3cb23160 100644 --- a/src/java.base/share/classes/java/time/format/DecimalStyle.java +++ b/src/java.base/share/classes/java/time/format/DecimalStyle.java @@ -147,6 +147,11 @@ public final class DecimalStyle { * Obtains the DecimalStyle for the specified locale. *

* This method provides access to locale sensitive decimal style symbols. + * If the locale contains "nu" (Numbering System) and/or "rg" + * (Region Override) + * Unicode extensions, returned instance will reflect the values specified with + * those extensions. If both "nu" and "rg" are specified, the value from + * the "nu" extension supersedes the implicit one from the "rg" extension. * * @param locale the locale, not null * @return the decimal style, not null diff --git a/src/java.base/share/classes/java/time/temporal/ChronoField.java b/src/java.base/share/classes/java/time/temporal/ChronoField.java index f124b114fa7..f1ef04ee07d 100644 --- a/src/java.base/share/classes/java/time/temporal/ChronoField.java +++ b/src/java.base/share/classes/java/time/temporal/ChronoField.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -79,6 +79,7 @@ import java.time.chrono.Chronology; import java.util.Locale; import java.util.Objects; import java.util.ResourceBundle; +import sun.util.locale.provider.CalendarDataUtility; import sun.util.locale.provider.LocaleProviderAdapter; import sun.util.locale.provider.LocaleResources; @@ -632,7 +633,9 @@ public enum ChronoField implements TemporalField { } LocaleResources lr = LocaleProviderAdapter.getResourceBundleBased() - .getLocaleResources(locale); + .getLocaleResources( + CalendarDataUtility + .findRegionOverride(locale)); ResourceBundle rb = lr.getJavaTimeFormatData(); String key = "field." + displayNameKey; return rb.containsKey(key) ? rb.getString(key) : name; diff --git a/src/java.base/share/classes/java/time/temporal/IsoFields.java b/src/java.base/share/classes/java/time/temporal/IsoFields.java index 0b910830126..1294bb1e8be 100644 --- a/src/java.base/share/classes/java/time/temporal/IsoFields.java +++ b/src/java.base/share/classes/java/time/temporal/IsoFields.java @@ -81,6 +81,7 @@ import java.util.Map; import java.util.Objects; import java.util.ResourceBundle; +import sun.util.locale.provider.CalendarDataUtility; import sun.util.locale.provider.LocaleProviderAdapter; import sun.util.locale.provider.LocaleResources; @@ -430,7 +431,9 @@ public final class IsoFields { public String getDisplayName(Locale locale) { Objects.requireNonNull(locale, "locale"); LocaleResources lr = LocaleProviderAdapter.getResourceBundleBased() - .getLocaleResources(locale); + .getLocaleResources( + CalendarDataUtility + .findRegionOverride(locale)); ResourceBundle rb = lr.getJavaTimeFormatData(); return rb.containsKey("field.week") ? rb.getString("field.week") : toString(); } diff --git a/src/java.base/share/classes/java/time/temporal/WeekFields.java b/src/java.base/share/classes/java/time/temporal/WeekFields.java index 0046bef9b68..b7a473f3b59 100644 --- a/src/java.base/share/classes/java/time/temporal/WeekFields.java +++ b/src/java.base/share/classes/java/time/temporal/WeekFields.java @@ -286,13 +286,17 @@ public final class WeekFields implements Serializable { * Obtains an instance of {@code WeekFields} appropriate for a locale. *

* This will look up appropriate values from the provider of localization data. + * If the locale contains "fw" (First day of week) and/or "rg" + * (Region Override) + * Unicode extensions, returned instance will reflect the values specified with + * those extensions. If both "fw" and "rg" are specified, the value from + * the "fw" extension supersedes the implicit one from the "rg" extension. * * @param locale the locale to use, not null * @return the week-definition, not null */ public static WeekFields of(Locale locale) { Objects.requireNonNull(locale, "locale"); - locale = new Locale(locale.getLanguage(), locale.getCountry()); // elminate variants int calDow = CalendarDataUtility.retrieveFirstDayOfWeek(locale); DayOfWeek dow = DayOfWeek.SUNDAY.plus(calDow - 1); @@ -1041,7 +1045,8 @@ public final class WeekFields implements Serializable { Objects.requireNonNull(locale, "locale"); if (rangeUnit == YEARS) { // only have values for week-of-year LocaleResources lr = LocaleProviderAdapter.getResourceBundleBased() - .getLocaleResources(locale); + .getLocaleResources( + CalendarDataUtility.findRegionOverride(locale)); ResourceBundle rb = lr.getJavaTimeFormatData(); return rb.containsKey("field.week") ? rb.getString("field.week") : name; } diff --git a/src/java.base/share/classes/java/util/Calendar.java b/src/java.base/share/classes/java/util/Calendar.java index d3731291c82..3debbb62cd2 100644 --- a/src/java.base/share/classes/java/util/Calendar.java +++ b/src/java.base/share/classes/java/util/Calendar.java @@ -58,6 +58,7 @@ import sun.util.BuddhistCalendar; import sun.util.calendar.ZoneInfo; import sun.util.locale.provider.CalendarDataUtility; import sun.util.locale.provider.LocaleProviderAdapter; +import sun.util.locale.provider.TimeZoneNameUtility; import sun.util.spi.CalendarProvider; /** @@ -128,9 +129,14 @@ import sun.util.spi.CalendarProvider; * * Calendar defines a locale-specific seven day week using two * parameters: the first day of the week and the minimal days in first week - * (from 1 to 7). These numbers are taken from the locale resource data when a - * Calendar is constructed. They may also be specified explicitly - * through the methods for setting their values. + * (from 1 to 7). These numbers are taken from the locale resource data or the + * locale itself when a {@code Calendar} is constructed. If the designated + * locale contains "fw" and/or "rg" + * Unicode extensions, the first day of the week will be obtained according to + * those extensions. If both "fw" and "rg" are specified, the value from the "fw" + * extension supersedes the implicit one from the "rg" extension. + * They may also be specified explicitly through the methods for setting their + * values. * *

When setting or getting the WEEK_OF_MONTH or * WEEK_OF_YEAR fields, Calendar must determine the @@ -1444,6 +1450,11 @@ public abstract class Calendar implements Serializable, Cloneable, ComparableThe default values are used for locale and time zone if these * parameters haven't been given explicitly. + *

+ * If the locale contains the time zone with "tz" + * Unicode extension, + * and time zone hasn't been given explicitly, time zone in the locale + * is used. * *

Any out of range field values are either normalized in lenient * mode or detected as an invalid value in non-lenient mode. @@ -1463,7 +1474,7 @@ public abstract class Calendar implements Serializable, Cloneable, ComparableCalendar returned is based on the current time * in the default time zone with the default * {@link Locale.Category#FORMAT FORMAT} locale. + *

+ * If the locale contains the time zone with "tz" + * Unicode extension, + * that time zone is used instead. * * @return a Calendar. */ public static Calendar getInstance() { - return createCalendar(TimeZone.getDefault(), Locale.getDefault(Locale.Category.FORMAT)); + Locale aLocale = Locale.getDefault(Locale.Category.FORMAT); + return createCalendar(defaultTimeZone(aLocale), aLocale); } /** @@ -1631,13 +1647,17 @@ public abstract class Calendar implements Serializable, Cloneable, ComparableCalendar returned is based on the current time * in the default time zone with the given locale. + *

+ * If the locale contains the time zone with "tz" + * Unicode extension, + * that time zone is used instead. * * @param aLocale the locale for the week data * @return a Calendar. */ public static Calendar getInstance(Locale aLocale) { - return createCalendar(TimeZone.getDefault(), aLocale); + return createCalendar(defaultTimeZone(aLocale), aLocale); } /** @@ -1655,6 +1675,16 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable + * If the specified {@code locale} contains "cu" and/or "rg" + * Unicode extensions, + * the instance returned from this method reflects + * the values specified with those extensions. If both "cu" and "rg" are + * specified, the currency from the "cu" extension supersedes the implicit one + * from the "rg" extension. + *

* The method returns null for territories that don't * have a currency, such as Antarctica. * @@ -361,12 +368,19 @@ public final class Currency implements Serializable { * is not a supported ISO 3166 country code. */ public static Currency getInstance(Locale locale) { - String country = locale.getCountry(); - if (country == null) { - throw new NullPointerException(); + // check for locale overrides + String override = locale.getUnicodeLocaleType("cu"); + if (override != null) { + try { + return getInstance(override.toUpperCase(Locale.ROOT)); + } catch (IllegalArgumentException iae) { + // override currency is invalid. Fall through. + } } - if (country.length() != 2) { + String country = CalendarDataUtility.findRegionOverride(locale).getCountry(); + + if (country == null || !country.matches("^[a-zA-Z]{2}$")) { throw new IllegalArgumentException(); } @@ -482,6 +496,12 @@ public final class Currency implements Serializable { * locale is the US, while for other locales it may be "US$". If no * symbol can be determined, the ISO 4217 currency code is returned. *

+ * If the default {@link Locale.Category#DISPLAY DISPLAY} locale + * contains "rg" (region override) + * Unicode extension, + * the symbol returned from this method reflects + * the value specified with that extension. + *

* This is equivalent to calling * {@link #getSymbol(Locale) * getSymbol(Locale.getDefault(Locale.Category.DISPLAY))}. @@ -498,6 +518,11 @@ public final class Currency implements Serializable { * For example, for the US Dollar, the symbol is "$" if the specified * locale is the US, while for other locales it may be "US$". If no * symbol can be determined, the ISO 4217 currency code is returned. + *

+ * If the specified {@code locale} contains "rg" (region override) + * Unicode extension, + * the symbol returned from this method reflects + * the value specified with that extension. * * @param locale the locale for which a display name for this currency is * needed @@ -507,6 +532,7 @@ public final class Currency implements Serializable { public String getSymbol(Locale locale) { LocaleServiceProviderPool pool = LocaleServiceProviderPool.getPool(CurrencyNameProvider.class); + locale = CalendarDataUtility.findRegionOverride(locale); String symbol = pool.getLocalizedObject( CurrencyNameGetter.INSTANCE, locale, currencyCode, SYMBOL); diff --git a/src/java.base/share/classes/java/util/Locale.java b/src/java.base/share/classes/java/util/Locale.java index 3bca8916052..d22183874d7 100644 --- a/src/java.base/share/classes/java/util/Locale.java +++ b/src/java.base/share/classes/java/util/Locale.java @@ -48,6 +48,7 @@ import java.io.Serializable; import java.text.MessageFormat; import java.util.concurrent.ConcurrentHashMap; import java.util.spi.LocaleNameProvider; +import java.util.stream.Collectors; import sun.security.action.GetPropertyAction; import sun.util.locale.BaseLocale; @@ -62,6 +63,7 @@ import sun.util.locale.ParseStatus; import sun.util.locale.provider.LocaleProviderAdapter; import sun.util.locale.provider.LocaleResources; import sun.util.locale.provider.LocaleServiceProviderPool; +import sun.util.locale.provider.TimeZoneNameUtility; /** * A Locale object represents a specific geographical, political, @@ -665,10 +667,12 @@ public final class Locale implements Cloneable, Serializable { /** * Display types for retrieving localized names from the name providers. */ - private static final int DISPLAY_LANGUAGE = 0; - private static final int DISPLAY_COUNTRY = 1; - private static final int DISPLAY_VARIANT = 2; - private static final int DISPLAY_SCRIPT = 3; + private static final int DISPLAY_LANGUAGE = 0; + private static final int DISPLAY_COUNTRY = 1; + private static final int DISPLAY_VARIANT = 2; + private static final int DISPLAY_SCRIPT = 3; + private static final int DISPLAY_UEXT_KEY = 4; + private static final int DISPLAY_UEXT_TYPE = 5; /** * Private constructor used by getInstance method @@ -942,11 +946,14 @@ public final class Locale implements Cloneable, Serializable { variant = props.getProperty("user.variant", ""); } - return getInstance(language, script, country, variant, null); + return getInstance(language, script, country, variant, + getDefaultExtensions(props.getProperty("user.extensions", "")) + .orElse(null)); } private static Locale initDefault(Locale.Category category) { Properties props = GetPropertyAction.privilegedGetProperties(); + return getInstance( props.getProperty(category.languageKey, defaultLocale.getLanguage()), @@ -956,7 +963,22 @@ public final class Locale implements Cloneable, Serializable { defaultLocale.getCountry()), props.getProperty(category.variantKey, defaultLocale.getVariant()), - null); + getDefaultExtensions(props.getProperty(category.extensionsKey, "")) + .orElse(defaultLocale.getLocaleExtensions())); + } + + private static Optional getDefaultExtensions(String extensionsProp) { + LocaleExtensions exts = null; + + try { + exts = new InternalLocaleBuilder() + .setExtensions(extensionsProp) + .getLocaleExtensions(); + } catch (LocaleSyntaxException e) { + // just ignore this incorrect property + } + + return Optional.ofNullable(exts); } /** @@ -1771,7 +1793,7 @@ public final class Locale implements Cloneable, Serializable { * @exception NullPointerException if inLocale is null */ public String getDisplayLanguage(Locale inLocale) { - return getDisplayString(baseLocale.getLanguage(), inLocale, DISPLAY_LANGUAGE); + return getDisplayString(baseLocale.getLanguage(), null, inLocale, DISPLAY_LANGUAGE); } /** @@ -1801,7 +1823,7 @@ public final class Locale implements Cloneable, Serializable { * @since 1.7 */ public String getDisplayScript(Locale inLocale) { - return getDisplayString(baseLocale.getScript(), inLocale, DISPLAY_SCRIPT); + return getDisplayString(baseLocale.getScript(), null, inLocale, DISPLAY_SCRIPT); } /** @@ -1844,29 +1866,24 @@ public final class Locale implements Cloneable, Serializable { * @exception NullPointerException if inLocale is null */ public String getDisplayCountry(Locale inLocale) { - return getDisplayString(baseLocale.getRegion(), inLocale, DISPLAY_COUNTRY); + return getDisplayString(baseLocale.getRegion(), null, inLocale, DISPLAY_COUNTRY); } - private String getDisplayString(String code, Locale inLocale, int type) { - if (code.length() == 0) { - return ""; - } + private String getDisplayString(String code, String cat, Locale inLocale, int type) { + Objects.requireNonNull(inLocale); + Objects.requireNonNull(code); - if (inLocale == null) { - throw new NullPointerException(); + if (code.isEmpty()) { + return ""; } LocaleServiceProviderPool pool = LocaleServiceProviderPool.getPool(LocaleNameProvider.class); - String key = (type == DISPLAY_VARIANT ? "%%"+code : code); + String rbKey = (type == DISPLAY_VARIANT ? "%%"+code : code); String result = pool.getLocalizedObject( LocaleNameGetter.INSTANCE, - inLocale, key, type, code); - if (result != null) { - return result; - } - - return code; + inLocale, rbKey, type, code, cat); + return result != null ? result : code; } /** @@ -1894,29 +1911,31 @@ public final class Locale implements Cloneable, Serializable { if (baseLocale.getVariant().length() == 0) return ""; - LocaleResources lr = LocaleProviderAdapter.forJRE().getLocaleResources(inLocale); + LocaleResources lr = LocaleProviderAdapter + .getResourceBundleBased() + .getLocaleResources(inLocale); String names[] = getDisplayVariantArray(inLocale); // Get the localized patterns for formatting a list, and use // them to format the list. return formatList(names, - lr.getLocaleName("ListPattern"), lr.getLocaleName("ListCompositionPattern")); } /** * Returns a name for the locale that is appropriate for display to the * user. This will be the values returned by getDisplayLanguage(), - * getDisplayScript(), getDisplayCountry(), and getDisplayVariant() assembled - * into a single string. The non-empty values are used in order, - * with the second and subsequent names in parentheses. For example: + * getDisplayScript(), getDisplayCountry(), getDisplayVariant() and + * optional Unicode extensions + * assembled into a single string. The non-empty values are used in order, with + * the second and subsequent names in parentheses. For example: *

- * language (script, country, variant)
- * language (country)
- * language (variant)
- * script (country)
- * country
+ * language (script, country, variant(, extension)*)
+ * language (country(, extension)*)
+ * language (variant(, extension)*)
+ * script (country(, extension)*)
+ * country (extension)*
*
* depending on which fields are specified in the locale. If the * language, script, country, and variant fields are all empty, @@ -1931,16 +1950,17 @@ public final class Locale implements Cloneable, Serializable { /** * Returns a name for the locale that is appropriate for display * to the user. This will be the values returned by - * getDisplayLanguage(), getDisplayScript(),getDisplayCountry(), - * and getDisplayVariant() assembled into a single string. - * The non-empty values are used in order, - * with the second and subsequent names in parentheses. For example: + * getDisplayLanguage(), getDisplayScript(),getDisplayCountry() + * getDisplayVariant(), and optional + * Unicode extensions assembled into a single string. The non-empty + * values are used in order, with the second and subsequent names in + * parentheses. For example: *
- * language (script, country, variant)
- * language (country)
- * language (variant)
- * script (country)
- * country
+ * language (script, country, variant(, extension)*)
+ * language (country(, extension)*)
+ * language (variant(, extension)*)
+ * script (country(, extension)*)
+ * country (extension)*
*
* depending on which fields are specified in the locale. If the * language, script, country, and variant fields are all empty, @@ -1951,7 +1971,9 @@ public final class Locale implements Cloneable, Serializable { * @throws NullPointerException if inLocale is null */ public String getDisplayName(Locale inLocale) { - LocaleResources lr = LocaleProviderAdapter.forJRE().getLocaleResources(inLocale); + LocaleResources lr = LocaleProviderAdapter + .getResourceBundleBased() + .getLocaleResources(inLocale); String languageName = getDisplayLanguage(inLocale); String scriptName = getDisplayScript(inLocale); @@ -1960,7 +1982,6 @@ public final class Locale implements Cloneable, Serializable { // Get the localized patterns for formatting a display name. String displayNamePattern = lr.getLocaleName("DisplayNamePattern"); - String listPattern = lr.getLocaleName("ListPattern"); String listCompositionPattern = lr.getLocaleName("ListCompositionPattern"); // The display name consists of a main name, followed by qualifiers. @@ -1977,7 +1998,7 @@ public final class Locale implements Cloneable, Serializable { if (variantNames.length == 0) { return ""; } else { - return formatList(variantNames, listPattern, listCompositionPattern); + return formatList(variantNames, listCompositionPattern); } } ArrayList names = new ArrayList<>(4); @@ -1994,6 +2015,16 @@ public final class Locale implements Cloneable, Serializable { names.addAll(Arrays.asList(variantNames)); } + // add Unicode extensions + if (localeExtensions != null) { + localeExtensions.getUnicodeLocaleAttributes().stream() + .map(key -> getDisplayString(key, null, inLocale, DISPLAY_UEXT_KEY)) + .forEach(names::add); + localeExtensions.getUnicodeLocaleKeys().stream() + .map(key -> getDisplayKeyTypeExtensionString(key, lr, inLocale)) + .forEach(names::add); + } + // The first one in the main name mainName = names.get(0); @@ -2014,7 +2045,7 @@ public final class Locale implements Cloneable, Serializable { // list case, but this is more efficient, and we want it to be // efficient since all the language-only locales will not have any // qualifiers. - qualifierNames.length != 0 ? formatList(qualifierNames, listPattern, listCompositionPattern) : null + qualifierNames.length != 0 ? formatList(qualifierNames, listCompositionPattern) : null }; if (displayNamePattern != null) { @@ -2121,74 +2152,78 @@ public final class Locale implements Cloneable, Serializable { // For each variant token, lookup the display name. If // not found, use the variant name itself. for (int i=0; i 3) { - MessageFormat format = new MessageFormat(listCompositionPattern); - stringList = composeList(format, stringList); + switch (stringList.length) { + case 0: + return ""; + case 1: + return stringList[0]; + default: + return Arrays.stream(stringList).reduce("", + (s1, s2) -> { + if (s1.equals("")) { + return s2; + } + if (s2.equals("")) { + return s1; + } + return MessageFormat.format(pattern, s1, s2); + }); } - - // Rebuild the argument list with the list length as the first element - Object[] args = new Object[stringList.length + 1]; - System.arraycopy(stringList, 0, args, 1, stringList.length); - args[0] = stringList.length; - - // Format it using the pattern in the resource - MessageFormat format = new MessageFormat(listPattern); - return format.format(args); - } - - /** - * Given a list of strings, return a list shortened to three elements. - * Shorten it by applying the given format to the first two elements - * recursively. - * @param format a format which takes two arguments - * @param list a list of strings - * @return if the list is three elements or shorter, the same list; - * otherwise, a new list of three elements. - */ - private static String[] composeList(MessageFormat format, String[] list) { - if (list.length <= 3) return list; - - // Use the given format to compose the first two elements into one - String[] listItems = { list[0], list[1] }; - String newItem = format.format(listItems); - - // Form a new list one element shorter - String[] newList = new String[list.length-1]; - System.arraycopy(list, 2, newList, 1, newList.length-1); - newList[0] = newItem; - - // Recurse - return composeList(format, newList); } // Duplicate of sun.util.locale.UnicodeLocaleExtension.isKey in order to @@ -2345,9 +2380,10 @@ public final class Locale implements Cloneable, Serializable { Locale locale, String key, Object... params) { - assert params.length == 2; + assert params.length == 3; int type = (Integer)params[0]; String code = (String)params[1]; + String cat = (String)params[2]; switch(type) { case DISPLAY_LANGUAGE: @@ -2358,6 +2394,10 @@ public final class Locale implements Cloneable, Serializable { return localeNameProvider.getDisplayVariant(code, locale); case DISPLAY_SCRIPT: return localeNameProvider.getDisplayScript(code, locale); + case DISPLAY_UEXT_KEY: + return localeNameProvider.getDisplayUnicodeExtensionKey(code, locale); + case DISPLAY_UEXT_TYPE: + return localeNameProvider.getDisplayUnicodeExtensionType(code, cat, locale); default: assert false; // shouldn't happen } @@ -2384,7 +2424,8 @@ public final class Locale implements Cloneable, Serializable { DISPLAY("user.language.display", "user.script.display", "user.country.display", - "user.variant.display"), + "user.variant.display", + "user.extensions.display"), /** * Category used to represent the default locale for @@ -2393,19 +2434,23 @@ public final class Locale implements Cloneable, Serializable { FORMAT("user.language.format", "user.script.format", "user.country.format", - "user.variant.format"); + "user.variant.format", + "user.extensions.format"); - Category(String languageKey, String scriptKey, String countryKey, String variantKey) { + Category(String languageKey, String scriptKey, String countryKey, + String variantKey, String extensionsKey) { this.languageKey = languageKey; this.scriptKey = scriptKey; this.countryKey = countryKey; this.variantKey = variantKey; + this.extensionsKey = extensionsKey; } final String languageKey; final String scriptKey; final String countryKey; final String variantKey; + final String extensionsKey; } /** diff --git a/src/java.base/share/classes/java/util/spi/LocaleNameProvider.java b/src/java.base/share/classes/java/util/spi/LocaleNameProvider.java index 499aa0dac1d..3701ddf84ca 100644 --- a/src/java.base/share/classes/java/util/spi/LocaleNameProvider.java +++ b/src/java.base/share/classes/java/util/spi/LocaleNameProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ package java.util.spi; import java.util.Locale; +import java.util.Objects; /** * An abstract class for service providers that @@ -141,4 +142,54 @@ public abstract class LocaleNameProvider extends LocaleServiceProvider { * @see java.util.Locale#getDisplayVariant(java.util.Locale) */ public abstract String getDisplayVariant(String variant, Locale locale); + + /** + * Returns a localized name for the given + * Unicode extension key, + * and the given locale that is appropriate for display to the user. + * If the name returned cannot be localized according to {@code locale}, + * this method returns null. + * @implSpec the default implementation returns {@code null}. + * @param key the Unicode Extension key, not null. + * @param locale the desired locale, not null. + * @return the name of the given key string for the specified locale, + * or null if it's not available. + * @exception NullPointerException if {@code key} or {@code locale} is null + * @exception IllegalArgumentException if {@code locale} isn't + * one of the locales returned from + * {@link java.util.spi.LocaleServiceProvider#getAvailableLocales() + * getAvailableLocales()}. + * @since 10 + */ + public String getDisplayUnicodeExtensionKey(String key, Locale locale) { + Objects.requireNonNull(key); + Objects.requireNonNull(locale); + return null; + } + + /** + * Returns a localized name for the given + * Unicode extension type, + * and the given locale that is appropriate for display to the user. + * If the name returned cannot be localized according to {@code locale}, + * this method returns null. + * @implSpec the default implementation returns {@code null}. + * @param type the Unicode Extension type, not null. + * @param key the Unicode Extension key for this {@code type}, not null. + * @param locale the desired locale, not null. + * @return the name of the given type string for the specified locale, + * or null if it's not available. + * @exception NullPointerException if {@code key}, {@code type} or {@code locale} is null + * @exception IllegalArgumentException if {@code locale} isn't + * one of the locales returned from + * {@link java.util.spi.LocaleServiceProvider#getAvailableLocales() + * getAvailableLocales()}. + * @since 10 + */ + public String getDisplayUnicodeExtensionType(String type, String key, Locale locale) { + Objects.requireNonNull(type); + Objects.requireNonNull(key); + Objects.requireNonNull(locale); + return null; + } } diff --git a/src/java.base/share/classes/sun/launcher/LauncherHelper.java b/src/java.base/share/classes/sun/launcher/LauncherHelper.java index 59a178e6cf7..38f9e3a6784 100644 --- a/src/java.base/share/classes/sun/launcher/LauncherHelper.java +++ b/src/java.base/share/classes/sun/launcher/LauncherHelper.java @@ -268,7 +268,7 @@ public final class LauncherHelper { Locale locale = Locale.getDefault(); ostream.println(LOCALE_SETTINGS); ostream.println(INDENT + "default locale = " + - locale.getDisplayLanguage()); + locale.getDisplayName()); ostream.println(INDENT + "default display locale = " + Locale.getDefault(Category.DISPLAY).getDisplayName()); ostream.println(INDENT + "default format locale = " + diff --git a/src/java.base/share/classes/sun/util/cldr/CLDRCalendarDataProviderImpl.java b/src/java.base/share/classes/sun/util/cldr/CLDRCalendarDataProviderImpl.java new file mode 100644 index 00000000000..212bdc6b6e5 --- /dev/null +++ b/src/java.base/share/classes/sun/util/cldr/CLDRCalendarDataProviderImpl.java @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.util.cldr; + +import static sun.util.locale.provider.LocaleProviderAdapter.Type; + +import java.util.Arrays; +import java.util.Map; +import java.util.Locale; +import java.util.Set; +import java.util.Optional; +import java.util.concurrent.ConcurrentHashMap; +import sun.util.locale.provider.LocaleProviderAdapter; +import sun.util.locale.provider.LocaleResources; +import sun.util.locale.provider.CalendarDataProviderImpl; +import sun.util.locale.provider.CalendarDataUtility; + +/** + * Concrete implementation of the + * {@link java.util.spi.CalendarDataProvider CalendarDataProvider} class + * for the CLDR LocaleProviderAdapter. + * + * @author Naoto Sato + */ +public class CLDRCalendarDataProviderImpl extends CalendarDataProviderImpl { + + private static Map firstDay = new ConcurrentHashMap<>(); + private static Map minDays = new ConcurrentHashMap<>(); + + public CLDRCalendarDataProviderImpl(Type type, Set langtags) { + super(type, langtags); + } + + @Override + public int getFirstDayOfWeek(Locale locale) { + return findValue(CalendarDataUtility.FIRST_DAY_OF_WEEK, locale); + } + + @Override + public int getMinimalDaysInFirstWeek(Locale locale) { + return findValue(CalendarDataUtility.MINIMAL_DAYS_IN_FIRST_WEEK, locale); + } + + /** + * Finds the requested integer value for the locale. + * Each resource consists of the following: + * + * (n: cc1 cc2 ... ccx;)* + * + * where 'n' is the integer for the following region codes, terminated by + * a ';'. + * + */ + private static int findValue(String key, Locale locale) { + Map map = CalendarDataUtility.FIRST_DAY_OF_WEEK.equals(key) ? + firstDay : minDays; + String region = locale.getCountry(); + + if (region.isEmpty()) { + return 0; + } + + Integer val = map.get(region); + if (val == null) { + String valStr = + LocaleProviderAdapter.forType(Type.CLDR).getLocaleResources(Locale.ROOT) + .getCalendarData(key); + val = retrieveInteger(valStr, region) + .orElse(retrieveInteger(valStr, "001").orElse(0)); + map.putIfAbsent(region, val); + } + + return val; + } + + private static Optional retrieveInteger(String src, String region) { + return Arrays.stream(src.split(";")) + .filter(entry -> entry.contains(region)) + .map(entry -> entry.substring(0, entry.indexOf(":"))) + .findAny() + .map(Integer::parseInt); + } +} diff --git a/src/java.base/share/classes/sun/util/cldr/CLDRLocaleProviderAdapter.java b/src/java.base/share/classes/sun/util/cldr/CLDRLocaleProviderAdapter.java index d1a92b8feb6..7bd7454bde1 100644 --- a/src/java.base/share/classes/sun/util/cldr/CLDRLocaleProviderAdapter.java +++ b/src/java.base/share/classes/sun/util/cldr/CLDRLocaleProviderAdapter.java @@ -27,6 +27,7 @@ package sun.util.cldr; import java.security.AccessController; import java.security.AccessControlException; +import java.security.PrivilegedAction; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.text.spi.BreakIteratorProvider; @@ -37,15 +38,16 @@ import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Map; -import java.util.Objects; +import java.util.Optional; import java.util.ServiceLoader; import java.util.ServiceConfigurationError; import java.util.Set; import java.util.StringTokenizer; import java.util.concurrent.ConcurrentHashMap; +import java.util.spi.CalendarDataProvider; import sun.util.locale.provider.JRELocaleProviderAdapter; -import sun.util.locale.provider.LocaleProviderAdapter; import sun.util.locale.provider.LocaleDataMetaInfo; +import sun.util.locale.provider.LocaleProviderAdapter; /** * LocaleProviderAdapter implementation for the CLDR locale data. @@ -105,6 +107,24 @@ public class CLDRLocaleProviderAdapter extends JRELocaleProviderAdapter { return null; } + @Override + public CalendarDataProvider getCalendarDataProvider() { + if (calendarDataProvider == null) { + CalendarDataProvider provider = AccessController.doPrivileged( + (PrivilegedAction) () -> + new CLDRCalendarDataProviderImpl( + getAdapterType(), + getLanguageTagSet("CalendarData"))); + + synchronized (this) { + if (calendarDataProvider == null) { + calendarDataProvider = provider; + } + } + } + return calendarDataProvider; + } + @Override public CollatorProvider getCollatorProvider() { return null; @@ -123,6 +143,10 @@ public class CLDRLocaleProviderAdapter extends JRELocaleProviderAdapter { @Override protected Set createLanguageTagSet(String category) { + // Assume all categories support the same set as AvailableLocales + // in CLDR adapter. + category = "AvailableLocales"; + // Directly call Base tags, as we know it's in the base module. String supportedLocaleString = baseMetaInfo.availableLanguageTags(category); String nonBaseTags = null; @@ -220,4 +244,11 @@ public class CLDRLocaleProviderAdapter extends JRELocaleProviderAdapter { || langtags.contains(locale.stripExtensions().toLanguageTag()) || langtags.contains(getEquivalentLoc(locale).toLanguageTag()); } + + /** + * Returns the time zone ID from an LDML's short ID + */ + public Optional getTimeZoneID(String shortID) { + return Optional.ofNullable(baseMetaInfo.tzShortIDs().get(shortID)); + } } diff --git a/src/java.base/share/classes/sun/util/locale/provider/CalendarDataProviderImpl.java b/src/java.base/share/classes/sun/util/locale/provider/CalendarDataProviderImpl.java index f8efe5234b3..ea1470b7974 100644 --- a/src/java.base/share/classes/sun/util/locale/provider/CalendarDataProviderImpl.java +++ b/src/java.base/share/classes/sun/util/locale/provider/CalendarDataProviderImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,14 +46,16 @@ public class CalendarDataProviderImpl extends CalendarDataProvider implements Av @Override public int getFirstDayOfWeek(Locale locale) { - return LocaleProviderAdapter.forType(type).getLocaleResources(locale) + String fw = LocaleProviderAdapter.forType(type).getLocaleResources(locale) .getCalendarData(CalendarDataUtility.FIRST_DAY_OF_WEEK); + return convertToCalendarData(fw); } @Override public int getMinimalDaysInFirstWeek(Locale locale) { - return LocaleProviderAdapter.forType(type).getLocaleResources(locale) + String md = LocaleProviderAdapter.forType(type).getLocaleResources(locale) .getCalendarData(CalendarDataUtility.MINIMAL_DAYS_IN_FIRST_WEEK); + return convertToCalendarData(md); } @Override @@ -65,4 +67,9 @@ public class CalendarDataProviderImpl extends CalendarDataProvider implements Av public Set getAvailableLanguageTags() { return langtags; } + + private int convertToCalendarData(String src) { + int val = Integer.parseInt(src); + return (src.isEmpty() || val <= 0 || val > 7) ? 0 : val; + } } diff --git a/src/java.base/share/classes/sun/util/locale/provider/CalendarDataUtility.java b/src/java.base/share/classes/sun/util/locale/provider/CalendarDataUtility.java index 2d2cc3e9d84..f6ee3d26912 100644 --- a/src/java.base/share/classes/sun/util/locale/provider/CalendarDataUtility.java +++ b/src/java.base/share/classes/sun/util/locale/provider/CalendarDataUtility.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,10 +47,34 @@ public class CalendarDataUtility { } public static int retrieveFirstDayOfWeek(Locale locale) { + // Look for the Unicode Extension in the locale parameter + if (locale.hasExtensions()) { + String fw = locale.getUnicodeLocaleType("fw"); + if (fw != null) { + switch (fw.toLowerCase(Locale.ROOT)) { + case "mon": + return MONDAY; + case "tue": + return TUESDAY; + case "wed": + return WEDNESDAY; + case "thu": + return THURSDAY; + case "fri": + return FRIDAY; + case "sat": + return SATURDAY; + case "sun": + return SUNDAY; + } + } + } + LocaleServiceProviderPool pool = LocaleServiceProviderPool.getPool(CalendarDataProvider.class); Integer value = pool.getLocalizedObject(CalendarWeekParameterGetter.INSTANCE, - locale, true, FIRST_DAY_OF_WEEK); + findRegionOverride(locale), + true, FIRST_DAY_OF_WEEK); return (value != null && (value >= SUNDAY && value <= SATURDAY)) ? value : SUNDAY; } @@ -58,7 +82,8 @@ public class CalendarDataUtility { LocaleServiceProviderPool pool = LocaleServiceProviderPool.getPool(CalendarDataProvider.class); Integer value = pool.getLocalizedObject(CalendarWeekParameterGetter.INSTANCE, - locale, true, MINIMAL_DAYS_IN_FIRST_WEEK); + findRegionOverride(locale), + true, MINIMAL_DAYS_IN_FIRST_WEEK); return (value != null && (value >= 1 && value <= 7)) ? value : 1; } @@ -102,6 +127,32 @@ public class CalendarDataUtility { return map; } + /** + * Utility to look for a region override extension. + * If no region override is found, returns the original locale. + */ + public static Locale findRegionOverride(Locale l) { + String rg = l.getUnicodeLocaleType("rg"); + Locale override = l; + + if (rg != null && rg.length() == 6) { + // UN M.49 code should not be allowed here + // cannot use regex here, as it could be a recursive call + rg = rg.toUpperCase(Locale.ROOT); + if (rg.charAt(0) >= 0x0041 && + rg.charAt(0) <= 0x005A && + rg.charAt(1) >= 0x0041 && + rg.charAt(1) <= 0x005A && + rg.substring(2).equals("ZZZZ")) { + override = new Locale.Builder().setLocale(l) + .setRegion(rg.substring(0, 2)) + .build(); + } + } + + return override; + } + static String normalizeCalendarType(String requestID) { String type; if (requestID.equals("gregorian") || requestID.equals("iso8601")) { @@ -179,7 +230,7 @@ public class CalendarDataUtility { } } - private static class CalendarWeekParameterGetter + private static class CalendarWeekParameterGetter implements LocaleServiceProviderPool.LocalizedObjectGetter { private static final CalendarWeekParameterGetter INSTANCE = diff --git a/src/java.base/share/classes/sun/util/locale/provider/DateFormatProviderImpl.java b/src/java.base/share/classes/sun/util/locale/provider/DateFormatProviderImpl.java index 87fc11ce05f..f9a8d4c346e 100644 --- a/src/java.base/share/classes/sun/util/locale/provider/DateFormatProviderImpl.java +++ b/src/java.base/share/classes/sun/util/locale/provider/DateFormatProviderImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,6 +32,7 @@ import java.util.Calendar; import java.util.Locale; import java.util.MissingResourceException; import java.util.Set; +import java.util.TimeZone; /** * Concrete implementation of the {@link java.text.spi.DateFormatProvider @@ -147,11 +148,14 @@ public class DateFormatProviderImpl extends DateFormatProvider implements Availa throw new NullPointerException(); } - SimpleDateFormat sdf = new SimpleDateFormat("", locale); + // Check for region override + Locale rg = CalendarDataUtility.findRegionOverride(locale); + + SimpleDateFormat sdf = new SimpleDateFormat("", rg); Calendar cal = sdf.getCalendar(); try { String pattern = LocaleProviderAdapter.forType(type) - .getLocaleResources(locale).getDateTimePattern(timeStyle, dateStyle, + .getLocaleResources(rg).getDateTimePattern(timeStyle, dateStyle, cal); sdf.applyPattern(pattern); } catch (MissingResourceException mre) { @@ -159,6 +163,15 @@ public class DateFormatProviderImpl extends DateFormatProvider implements Availa sdf.applyPattern("M/d/yy h:mm a"); } + // Check for timezone override + String tz = locale.getUnicodeLocaleType("tz"); + if (tz != null) { + sdf.setTimeZone( + TimeZoneNameUtility.convertLDMLShortID(tz) + .map(TimeZone::getTimeZone) + .orElseGet(sdf::getTimeZone)); + } + return sdf; } diff --git a/src/java.base/share/classes/sun/util/locale/provider/JRELocaleProviderAdapter.java b/src/java.base/share/classes/sun/util/locale/provider/JRELocaleProviderAdapter.java index aca1dfe4e01..de0cd3aa473 100644 --- a/src/java.base/share/classes/sun/util/locale/provider/JRELocaleProviderAdapter.java +++ b/src/java.base/share/classes/sun/util/locale/provider/JRELocaleProviderAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -130,7 +130,7 @@ public class JRELocaleProviderAdapter extends LocaleProviderAdapter implements R private volatile CurrencyNameProvider currencyNameProvider; private volatile LocaleNameProvider localeNameProvider; private volatile TimeZoneNameProvider timeZoneNameProvider; - private volatile CalendarDataProvider calendarDataProvider; + protected volatile CalendarDataProvider calendarDataProvider; private volatile CalendarNameProvider calendarNameProvider; private volatile CalendarProvider calendarProvider; diff --git a/src/java.base/share/classes/sun/util/locale/provider/LocaleDataMetaInfo.java b/src/java.base/share/classes/sun/util/locale/provider/LocaleDataMetaInfo.java index 149348f66d0..fa104df60b8 100644 --- a/src/java.base/share/classes/sun/util/locale/provider/LocaleDataMetaInfo.java +++ b/src/java.base/share/classes/sun/util/locale/provider/LocaleDataMetaInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,8 @@ package sun.util.locale.provider; +import java.util.Map; + /** * LocaleData meta info SPI * @@ -46,4 +48,13 @@ public interface LocaleDataMetaInfo { * @return concatenated language tags, separated by a space. */ public String availableLanguageTags(String category); + + /** + * Returns a map for short time zone ids in BCP47 Unicode extension and + * the long time zone ids. + * @return map of short id to long ids, separated by a space. + */ + default public Map tzShortIDs() { + return null; + } } diff --git a/src/java.base/share/classes/sun/util/locale/provider/LocaleNameProviderImpl.java b/src/java.base/share/classes/sun/util/locale/provider/LocaleNameProviderImpl.java index aa2c18935c2..708eb11fc32 100644 --- a/src/java.base/share/classes/sun/util/locale/provider/LocaleNameProviderImpl.java +++ b/src/java.base/share/classes/sun/util/locale/provider/LocaleNameProviderImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -168,6 +168,28 @@ public class LocaleNameProviderImpl extends LocaleNameProvider implements Availa return getDisplayString("%%"+vrnt, locale); } + /** + * @inheritDoc + */ + @Override + public String getDisplayUnicodeExtensionKey(String key, Locale locale) { + super.getDisplayUnicodeExtensionKey(key, locale); // null check + String rbKey = "key." + key; + String name = getDisplayString(rbKey, locale); + return rbKey.equals(name) ? key : name; + } + + /** + * @inheritDoc + */ + @Override + public String getDisplayUnicodeExtensionType(String extType, String key, Locale locale) { + super.getDisplayUnicodeExtensionType(extType, key, locale); // null check + String rbKey = "type." + key + "." + extType; + String name = getDisplayString(rbKey, locale); + return rbKey.equals(name) ? extType : name; + } + private String getDisplayString(String key, Locale locale) { if (key == null || locale == null) { throw new NullPointerException(); diff --git a/src/java.base/share/classes/sun/util/locale/provider/LocaleResources.java b/src/java.base/share/classes/sun/util/locale/provider/LocaleResources.java index a6f3bc53bb0..533eb315992 100644 --- a/src/java.base/share/classes/sun/util/locale/provider/LocaleResources.java +++ b/src/java.base/share/classes/sun/util/locale/provider/LocaleResources.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -122,23 +122,21 @@ public class LocaleResources { return (byte[]) localeData.getBreakIteratorResources(locale).getObject(key); } - int getCalendarData(String key) { - Integer caldata; + public String getCalendarData(String key) { + String caldata = ""; String cacheKey = CALENDAR_DATA + key; removeEmptyReferences(); ResourceReference data = cache.get(cacheKey); - if (data == null || ((caldata = (Integer) data.get()) == null)) { + if (data == null || ((caldata = (String) data.get()) == null)) { ResourceBundle rb = localeData.getCalendarData(locale); if (rb.containsKey(key)) { - caldata = Integer.parseInt(rb.getString(key)); - } else { - caldata = 0; + caldata = rb.getString(key); } cache.put(cacheKey, - new ResourceReference(cacheKey, (Object) caldata, referenceQueue)); + new ResourceReference(cacheKey, caldata, referenceQueue)); } return caldata; diff --git a/src/java.base/share/classes/sun/util/locale/provider/NumberFormatProviderImpl.java b/src/java.base/share/classes/sun/util/locale/provider/NumberFormatProviderImpl.java index f1edd5843a7..c2f6e593338 100644 --- a/src/java.base/share/classes/sun/util/locale/provider/NumberFormatProviderImpl.java +++ b/src/java.base/share/classes/sun/util/locale/provider/NumberFormatProviderImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -173,9 +173,14 @@ public class NumberFormatProviderImpl extends NumberFormatProvider implements Av throw new NullPointerException(); } + // Check for region override + Locale override = locale.getUnicodeLocaleType("nu") == null ? + CalendarDataUtility.findRegionOverride(locale) : + locale; + LocaleProviderAdapter adapter = LocaleProviderAdapter.forType(type); - String[] numberPatterns = adapter.getLocaleResources(locale).getNumberPatterns(); - DecimalFormatSymbols symbols = DecimalFormatSymbols.getInstance(locale); + String[] numberPatterns = adapter.getLocaleResources(override).getNumberPatterns(); + DecimalFormatSymbols symbols = DecimalFormatSymbols.getInstance(override); int entry = (choice == INTEGERSTYLE) ? NUMBERSTYLE : choice; DecimalFormat format = new DecimalFormat(numberPatterns[entry], symbols); diff --git a/src/java.base/share/classes/sun/util/locale/provider/SPILocaleProviderAdapter.java b/src/java.base/share/classes/sun/util/locale/provider/SPILocaleProviderAdapter.java index 4066fcdabfd..82dbee0230e 100644 --- a/src/java.base/share/classes/sun/util/locale/provider/SPILocaleProviderAdapter.java +++ b/src/java.base/share/classes/sun/util/locale/provider/SPILocaleProviderAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -160,28 +160,24 @@ public class SPILocaleProviderAdapter extends AuxLocaleProviderAdapter { @Override public BreakIterator getWordInstance(Locale locale) { BreakIteratorProvider bip = getImpl(locale); - assert bip != null; return bip.getWordInstance(locale); } @Override public BreakIterator getLineInstance(Locale locale) { BreakIteratorProvider bip = getImpl(locale); - assert bip != null; return bip.getLineInstance(locale); } @Override public BreakIterator getCharacterInstance(Locale locale) { BreakIteratorProvider bip = getImpl(locale); - assert bip != null; return bip.getCharacterInstance(locale); } @Override public BreakIterator getSentenceInstance(Locale locale) { BreakIteratorProvider bip = getImpl(locale); - assert bip != null; return bip.getSentenceInstance(locale); } @@ -215,7 +211,6 @@ public class SPILocaleProviderAdapter extends AuxLocaleProviderAdapter { @Override public Collator getInstance(Locale locale) { CollatorProvider cp = getImpl(locale); - assert cp != null; return cp.getInstance(locale); } } @@ -249,21 +244,18 @@ public class SPILocaleProviderAdapter extends AuxLocaleProviderAdapter { @Override public DateFormat getTimeInstance(int style, Locale locale) { DateFormatProvider dfp = getImpl(locale); - assert dfp != null; return dfp.getTimeInstance(style, locale); } @Override public DateFormat getDateInstance(int style, Locale locale) { DateFormatProvider dfp = getImpl(locale); - assert dfp != null; return dfp.getDateInstance(style, locale); } @Override public DateFormat getDateTimeInstance(int dateStyle, int timeStyle, Locale locale) { DateFormatProvider dfp = getImpl(locale); - assert dfp != null; return dfp.getDateTimeInstance(dateStyle, timeStyle, locale); } } @@ -297,7 +289,6 @@ public class SPILocaleProviderAdapter extends AuxLocaleProviderAdapter { @Override public DateFormatSymbols getInstance(Locale locale) { DateFormatSymbolsProvider dfsp = getImpl(locale); - assert dfsp != null; return dfsp.getInstance(locale); } } @@ -331,7 +322,6 @@ public class SPILocaleProviderAdapter extends AuxLocaleProviderAdapter { @Override public DecimalFormatSymbols getInstance(Locale locale) { DecimalFormatSymbolsProvider dfsp = getImpl(locale); - assert dfsp != null; return dfsp.getInstance(locale); } } @@ -365,28 +355,24 @@ public class SPILocaleProviderAdapter extends AuxLocaleProviderAdapter { @Override public NumberFormat getCurrencyInstance(Locale locale) { NumberFormatProvider nfp = getImpl(locale); - assert nfp != null; return nfp.getCurrencyInstance(locale); } @Override public NumberFormat getIntegerInstance(Locale locale) { NumberFormatProvider nfp = getImpl(locale); - assert nfp != null; return nfp.getIntegerInstance(locale); } @Override public NumberFormat getNumberInstance(Locale locale) { NumberFormatProvider nfp = getImpl(locale); - assert nfp != null; return nfp.getNumberInstance(locale); } @Override public NumberFormat getPercentInstance(Locale locale) { NumberFormatProvider nfp = getImpl(locale); - assert nfp != null; return nfp.getPercentInstance(locale); } } @@ -420,14 +406,12 @@ public class SPILocaleProviderAdapter extends AuxLocaleProviderAdapter { @Override public int getFirstDayOfWeek(Locale locale) { CalendarDataProvider cdp = getImpl(locale); - assert cdp != null; return cdp.getFirstDayOfWeek(locale); } @Override public int getMinimalDaysInFirstWeek(Locale locale) { CalendarDataProvider cdp = getImpl(locale); - assert cdp != null; return cdp.getMinimalDaysInFirstWeek(locale); } } @@ -463,7 +447,6 @@ public class SPILocaleProviderAdapter extends AuxLocaleProviderAdapter { int field, int value, int style, Locale locale) { CalendarNameProvider cdp = getImpl(locale); - assert cdp != null; return cdp.getDisplayName(calendarType, field, value, style, locale); } @@ -472,7 +455,6 @@ public class SPILocaleProviderAdapter extends AuxLocaleProviderAdapter { int field, int style, Locale locale) { CalendarNameProvider cdp = getImpl(locale); - assert cdp != null; return cdp.getDisplayNames(calendarType, field, style, locale); } } @@ -506,14 +488,12 @@ public class SPILocaleProviderAdapter extends AuxLocaleProviderAdapter { @Override public String getSymbol(String currencyCode, Locale locale) { CurrencyNameProvider cnp = getImpl(locale); - assert cnp != null; return cnp.getSymbol(currencyCode, locale); } @Override public String getDisplayName(String currencyCode, Locale locale) { CurrencyNameProvider cnp = getImpl(locale); - assert cnp != null; return cnp.getDisplayName(currencyCode, locale); } } @@ -547,30 +527,38 @@ public class SPILocaleProviderAdapter extends AuxLocaleProviderAdapter { @Override public String getDisplayLanguage(String languageCode, Locale locale) { LocaleNameProvider lnp = getImpl(locale); - assert lnp != null; return lnp.getDisplayLanguage(languageCode, locale); } @Override public String getDisplayScript(String scriptCode, Locale locale) { LocaleNameProvider lnp = getImpl(locale); - assert lnp != null; return lnp.getDisplayScript(scriptCode, locale); } @Override public String getDisplayCountry(String countryCode, Locale locale) { LocaleNameProvider lnp = getImpl(locale); - assert lnp != null; return lnp.getDisplayCountry(countryCode, locale); } @Override public String getDisplayVariant(String variant, Locale locale) { LocaleNameProvider lnp = getImpl(locale); - assert lnp != null; return lnp.getDisplayVariant(variant, locale); } + + @Override + public String getDisplayUnicodeExtensionKey(String key, Locale locale) { + LocaleNameProvider lnp = getImpl(locale); + return lnp.getDisplayUnicodeExtensionKey(key, locale); + } + + @Override + public String getDisplayUnicodeExtensionType(String extType, String key, Locale locale) { + LocaleNameProvider lnp = getImpl(locale); + return lnp.getDisplayUnicodeExtensionType(extType, key, locale); + } } static class TimeZoneNameProviderDelegate extends TimeZoneNameProvider @@ -602,14 +590,12 @@ public class SPILocaleProviderAdapter extends AuxLocaleProviderAdapter { @Override public String getDisplayName(String ID, boolean daylight, int style, Locale locale) { TimeZoneNameProvider tznp = getImpl(locale); - assert tznp != null; return tznp.getDisplayName(ID, daylight, style, locale); } @Override public String getGenericDisplayName(String ID, int style, Locale locale) { TimeZoneNameProvider tznp = getImpl(locale); - assert tznp != null; return tznp.getGenericDisplayName(ID, style, locale); } } diff --git a/src/java.base/share/classes/sun/util/locale/provider/TimeZoneNameUtility.java b/src/java.base/share/classes/sun/util/locale/provider/TimeZoneNameUtility.java index 9fc1502787a..57cfa1b05c6 100644 --- a/src/java.base/share/classes/sun/util/locale/provider/TimeZoneNameUtility.java +++ b/src/java.base/share/classes/sun/util/locale/provider/TimeZoneNameUtility.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,10 +31,13 @@ import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Objects; +import java.util.Optional; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.spi.TimeZoneNameProvider; import sun.util.calendar.ZoneInfo; +import sun.util.cldr.CLDRLocaleProviderAdapter; +import static sun.util.locale.provider.LocaleProviderAdapter.Type; /** * Utility class that deals with the localized time zone names @@ -152,6 +155,18 @@ public final class TimeZoneNameUtility { } } + /** + * Converts the time zone id from LDML's 5-letter id to tzdb's id + * + * @param shortID time zone short ID defined in LDML + * @return the tzdb's time zone ID + */ + public static Optional convertLDMLShortID(String shortID) { + return ((CLDRLocaleProviderAdapter)LocaleProviderAdapter.forType(Type.CLDR)) + .getTimeZoneID(shortID) + .map(id -> id.replaceAll("\\s.*", "")); + } + private static String[] retrieveDisplayNamesImpl(String id, Locale locale) { LocaleServiceProviderPool pool = LocaleServiceProviderPool.getPool(TimeZoneNameProvider.class); diff --git a/src/java.base/share/classes/sun/util/resources/LocaleNames.properties b/src/java.base/share/classes/sun/util/resources/LocaleNames.properties index 9b3fdda25d3..459241331f4 100644 --- a/src/java.base/share/classes/sun/util/resources/LocaleNames.properties +++ b/src/java.base/share/classes/sun/util/resources/LocaleNames.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -1164,8 +1164,7 @@ ZW=Zimbabwe # locale name patterns -# rarely localized DisplayNamePattern={0,choice,0#|1#{1}|2#{1} ({2})} -ListPattern={0,choice,0#|1#{1}|2#{1},{2}|3#{1},{2},{3}} +ListKeyTypePattern={0}:{1} ListCompositionPattern={0},{1} diff --git a/src/jdk.localedata/share/classes/sun/util/cldr/resources/common/bcp47/timezone.xml b/src/jdk.localedata/share/classes/sun/util/cldr/resources/common/bcp47/timezone.xml new file mode 100644 index 00000000000..ea7ff1b55f4 --- /dev/null +++ b/src/jdk.localedata/share/classes/sun/util/cldr/resources/common/bcp47/timezone.xml @@ -0,0 +1,470 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/jdk.localedata/share/classes/sun/util/cldr/resources/common/dtd/ldmlBCP47.dtd b/src/jdk.localedata/share/classes/sun/util/cldr/resources/common/dtd/ldmlBCP47.dtd new file mode 100644 index 00000000000..6fdced3efda --- /dev/null +++ b/src/jdk.localedata/share/classes/sun/util/cldr/resources/common/dtd/ldmlBCP47.dtd @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/java/util/Calendar/Bug8185841.java b/test/java/util/Calendar/Bug8185841.java deleted file mode 100644 index bb795512a6e..00000000000 --- a/test/java/util/Calendar/Bug8185841.java +++ /dev/null @@ -1,278 +0,0 @@ -/* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - /* - * @test - * @bug 8185841 - * @summary Test that Region dependent Bundles are added/removed correctly. - * @modules jdk.localedata - */ - - /* -This test is dependent on a particular version of CLDR. - */ -import java.net.URI; -import java.nio.file.FileSystem; -import java.nio.file.FileSystems; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; -import java.util.stream.Collectors; - -public class Bug8185841 { - // Golden data for Region dependent Bundles in CLDR29. - - private static final Set expectedBundles - = Set.of("CalendarData_af_NA.class", "CalendarData_af_ZA.class", "CalendarData_agq_CM.class", - "CalendarData_ak_GH.class", "CalendarData_am_ET.class", "CalendarData_ar_AE.class", - "CalendarData_ar_BH.class", "CalendarData_ar_DJ.class", "CalendarData_ar_DZ.class", - "CalendarData_ar_EG.class", "CalendarData_ar_EH.class", "CalendarData_ar_ER.class", - "CalendarData_ar_IL.class", "CalendarData_ar_IQ.class", "CalendarData_ar_JO.class", - "CalendarData_ar_KM.class", "CalendarData_ar_KW.class", "CalendarData_ar_LB.class", - "CalendarData_ar_LY.class", "CalendarData_ar_MA.class", "CalendarData_ar_MR.class", - "CalendarData_ar_OM.class", "CalendarData_ar_PS.class", "CalendarData_ar_QA.class", - "CalendarData_ar_SA.class", "CalendarData_ar_SD.class", "CalendarData_ar_SO.class", - "CalendarData_ar_SS.class", "CalendarData_ar_SY.class", "CalendarData_ar_TD.class", - "CalendarData_ar_TN.class", "CalendarData_ar_YE.class", "CalendarData_as_IN.class", - "CalendarData_asa_TZ.class", "CalendarData_ast_ES.class", "CalendarData_az_AZ.class", - "CalendarData_az_Cyrl_AZ.class", "CalendarData_bas_CM.class", "CalendarData_be_BY.class", - "CalendarData_bem_ZM.class", "CalendarData_bez_TZ.class", "CalendarData_bg_BG.class", - "CalendarData_bm_ML.class", "CalendarData_bn_BD.class", "CalendarData_bn_IN.class", - "CalendarData_bo_CN.class", "CalendarData_bo_IN.class", "CalendarData_br_FR.class", - "CalendarData_brx_IN.class", "CalendarData_bs_BA.class", "CalendarData_bs_Cyrl_BA.class", - "CalendarData_ca_AD.class", "CalendarData_ca_ES.class", "CalendarData_ca_FR.class", - "CalendarData_ca_IT.class", "CalendarData_ce_RU.class", "CalendarData_cgg_UG.class", - "CalendarData_chr_US.class", "CalendarData_ckb_IQ.class", "CalendarData_ckb_IR.class", - "CalendarData_cs_CZ.class", "CalendarData_cu_RU.class", "CalendarData_cy_GB.class", - "CalendarData_da_DK.class", "CalendarData_da_GL.class", "CalendarData_dav_KE.class", - "CalendarData_de_AT.class", "CalendarData_de_BE.class", "CalendarData_de_CH.class", - "CalendarData_de_DE.class", "CalendarData_de_LI.class", "CalendarData_de_LU.class", - "CalendarData_dje_NE.class", "CalendarData_dsb_DE.class", "CalendarData_dua_CM.class", - "CalendarData_dyo_SN.class", "CalendarData_dz_BT.class", "CalendarData_ebu_KE.class", - "CalendarData_ee_GH.class", "CalendarData_ee_TG.class", "CalendarData_el_CY.class", - "CalendarData_el_GR.class", "CalendarData_en_AG.class", "CalendarData_en_AI.class", - "CalendarData_en_AS.class", "CalendarData_en_AT.class", "CalendarData_en_AU.class", - "CalendarData_en_BB.class", "CalendarData_en_BE.class", "CalendarData_en_BI.class", - "CalendarData_en_BM.class", "CalendarData_en_BS.class", "CalendarData_en_BW.class", - "CalendarData_en_BZ.class", "CalendarData_en_CA.class", "CalendarData_en_CC.class", - "CalendarData_en_CH.class", "CalendarData_en_CK.class", "CalendarData_en_CM.class", - "CalendarData_en_CX.class", "CalendarData_en_CY.class", "CalendarData_en_DE.class", - "CalendarData_en_DG.class", "CalendarData_en_DK.class", "CalendarData_en_DM.class", - "CalendarData_en_ER.class", "CalendarData_en_FI.class", "CalendarData_en_FJ.class", - "CalendarData_en_FK.class", "CalendarData_en_FM.class", "CalendarData_en_GB.class", - "CalendarData_en_GD.class", "CalendarData_en_GG.class", "CalendarData_en_GH.class", - "CalendarData_en_GI.class", "CalendarData_en_GM.class", "CalendarData_en_GU.class", - "CalendarData_en_GY.class", "CalendarData_en_HK.class", "CalendarData_en_IE.class", - "CalendarData_en_IL.class", "CalendarData_en_IM.class", "CalendarData_en_IN.class", - "CalendarData_en_IO.class", "CalendarData_en_JE.class", "CalendarData_en_JM.class", - "CalendarData_en_KE.class", "CalendarData_en_KI.class", "CalendarData_en_KN.class", - "CalendarData_en_KY.class", "CalendarData_en_LC.class", "CalendarData_en_LR.class", - "CalendarData_en_LS.class", "CalendarData_en_MG.class", "CalendarData_en_MH.class", - "CalendarData_en_MO.class", "CalendarData_en_MP.class", "CalendarData_en_MS.class", - "CalendarData_en_MT.class", "CalendarData_en_MU.class", "CalendarData_en_MW.class", - "CalendarData_en_MY.class", "CalendarData_en_NA.class", "CalendarData_en_NF.class", - "CalendarData_en_NG.class", "CalendarData_en_NL.class", "CalendarData_en_NR.class", - "CalendarData_en_NU.class", "CalendarData_en_NZ.class", "CalendarData_en_PG.class", - "CalendarData_en_PH.class", "CalendarData_en_PK.class", "CalendarData_en_PN.class", - "CalendarData_en_PR.class", "CalendarData_en_PW.class", "CalendarData_en_RW.class", - "CalendarData_en_SB.class", "CalendarData_en_SC.class", "CalendarData_en_SD.class", - "CalendarData_en_SE.class", "CalendarData_en_SG.class", "CalendarData_en_SH.class", - "CalendarData_en_SI.class", "CalendarData_en_SL.class", "CalendarData_en_SS.class", - "CalendarData_en_SX.class", "CalendarData_en_SZ.class", "CalendarData_en_TC.class", - "CalendarData_en_TK.class", "CalendarData_en_TO.class", "CalendarData_en_TT.class", - "CalendarData_en_TV.class", "CalendarData_en_TZ.class", "CalendarData_en_UG.class", - "CalendarData_en_UM.class", "CalendarData_en_VC.class", "CalendarData_en_VG.class", - "CalendarData_en_VI.class", "CalendarData_en_VU.class", "CalendarData_en_WS.class", - "CalendarData_en_ZA.class", "CalendarData_en_ZM.class", "CalendarData_en_ZW.class", - "CalendarData_es_AR.class", "CalendarData_es_BO.class", "CalendarData_es_BR.class", - "CalendarData_es_CL.class", "CalendarData_es_CO.class", "CalendarData_es_CR.class", - "CalendarData_es_CU.class", "CalendarData_es_DO.class", "CalendarData_es_EA.class", - "CalendarData_es_EC.class", "CalendarData_es_ES.class", "CalendarData_es_GQ.class", - "CalendarData_es_GT.class", "CalendarData_es_HN.class", "CalendarData_es_IC.class", - "CalendarData_es_MX.class", "CalendarData_es_NI.class", "CalendarData_es_PA.class", - "CalendarData_es_PE.class", "CalendarData_es_PH.class", "CalendarData_es_PR.class", - "CalendarData_es_PY.class", "CalendarData_es_SV.class", "CalendarData_es_US.class", - "CalendarData_es_UY.class", "CalendarData_es_VE.class", "CalendarData_et_EE.class", - "CalendarData_eu_ES.class", "CalendarData_ewo_CM.class", "CalendarData_fa_AF.class", - "CalendarData_fa_IR.class", "CalendarData_ff_CM.class", "CalendarData_ff_GN.class", - "CalendarData_ff_MR.class", "CalendarData_ff_SN.class", "CalendarData_fi_FI.class", - "CalendarData_fil_PH.class", "CalendarData_fo_DK.class", "CalendarData_fo_FO.class", - "CalendarData_fr_BE.class", "CalendarData_fr_BF.class", "CalendarData_fr_BI.class", - "CalendarData_fr_BJ.class", "CalendarData_fr_BL.class", "CalendarData_fr_CA.class", - "CalendarData_fr_CD.class", "CalendarData_fr_CF.class", "CalendarData_fr_CG.class", - "CalendarData_fr_CH.class", "CalendarData_fr_CI.class", "CalendarData_fr_CM.class", - "CalendarData_fr_DJ.class", "CalendarData_fr_DZ.class", "CalendarData_fr_FR.class", - "CalendarData_fr_GA.class", "CalendarData_fr_GF.class", "CalendarData_fr_GN.class", - "CalendarData_fr_GP.class", "CalendarData_fr_GQ.class", "CalendarData_fr_HT.class", - "CalendarData_fr_KM.class", "CalendarData_fr_LU.class", "CalendarData_fr_MA.class", - "CalendarData_fr_MC.class", "CalendarData_fr_MF.class", "CalendarData_fr_MG.class", - "CalendarData_fr_ML.class", "CalendarData_fr_MQ.class", "CalendarData_fr_MR.class", - "CalendarData_fr_MU.class", "CalendarData_fr_NC.class", "CalendarData_fr_NE.class", - "CalendarData_fr_PF.class", "CalendarData_fr_PM.class", "CalendarData_fr_RE.class", - "CalendarData_fr_RW.class", "CalendarData_fr_SC.class", "CalendarData_fr_SN.class", - "CalendarData_fr_SY.class", "CalendarData_fr_TD.class", "CalendarData_fr_TG.class", - "CalendarData_fr_TN.class", "CalendarData_fr_VU.class", "CalendarData_fr_WF.class", - "CalendarData_fr_YT.class", "CalendarData_fur_IT.class", "CalendarData_fy_NL.class", - "CalendarData_ga_IE.class", "CalendarData_gd_GB.class", "CalendarData_gl_ES.class", - "CalendarData_gsw_CH.class", "CalendarData_gsw_FR.class", "CalendarData_gsw_LI.class", - "CalendarData_gu_IN.class", "CalendarData_guz_KE.class", "CalendarData_gv_IM.class", - "CalendarData_ha_GH.class", "CalendarData_ha_NE.class", "CalendarData_ha_NG.class", - "CalendarData_haw_US.class", "CalendarData_hi_IN.class", "CalendarData_hr_BA.class", - "CalendarData_hr_HR.class", "CalendarData_hsb_DE.class", "CalendarData_hu_HU.class", - "CalendarData_hy_AM.class", "CalendarData_ig_NG.class", "CalendarData_ii_CN.class", - "CalendarData_in_ID.class", "CalendarData_is_IS.class", "CalendarData_it_CH.class", - "CalendarData_it_IT.class", "CalendarData_it_SM.class", "CalendarData_iw_IL.class", - "CalendarData_ja_JP.class", "CalendarData_jgo_CM.class", "CalendarData_jmc_TZ.class", - "CalendarData_ka_GE.class", "CalendarData_kab_DZ.class", "CalendarData_kam_KE.class", - "CalendarData_kde_TZ.class", "CalendarData_kea_CV.class", "CalendarData_khq_ML.class", - "CalendarData_ki_KE.class", "CalendarData_kk_KZ.class", "CalendarData_kkj_CM.class", - "CalendarData_kl_GL.class", "CalendarData_kln_KE.class", "CalendarData_km_KH.class", - "CalendarData_kn_IN.class", "CalendarData_ko_KP.class", "CalendarData_ko_KR.class", - "CalendarData_kok_IN.class", "CalendarData_ks_IN.class", "CalendarData_ksb_TZ.class", - "CalendarData_ksf_CM.class", "CalendarData_ksh_DE.class", "CalendarData_kw_GB.class", - "CalendarData_ky_KG.class", "CalendarData_lag_TZ.class", "CalendarData_lb_LU.class", - "CalendarData_lg_UG.class", "CalendarData_lkt_US.class", "CalendarData_ln_AO.class", - "CalendarData_ln_CD.class", "CalendarData_ln_CF.class", "CalendarData_ln_CG.class", - "CalendarData_lo_LA.class", "CalendarData_lrc_IQ.class", "CalendarData_lrc_IR.class", - "CalendarData_lt_LT.class", "CalendarData_lu_CD.class", "CalendarData_luo_KE.class", - "CalendarData_luy_KE.class", "CalendarData_lv_LV.class", "CalendarData_mas_KE.class", - "CalendarData_mas_TZ.class", "CalendarData_mer_KE.class", "CalendarData_mfe_MU.class", - "CalendarData_mg_MG.class", "CalendarData_mgh_MZ.class", "CalendarData_mgo_CM.class", - "CalendarData_mk_MK.class", "CalendarData_ml_IN.class", "CalendarData_mn_MN.class", - "CalendarData_mr_IN.class", "CalendarData_ms_BN.class", "CalendarData_ms_MY.class", - "CalendarData_ms_SG.class", "CalendarData_mt_MT.class", "CalendarData_mua_CM.class", - "CalendarData_my_MM.class", "CalendarData_mzn_IR.class", "CalendarData_naq_NA.class", - "CalendarData_nb_NO.class", "CalendarData_nb_SJ.class", "CalendarData_nd_ZW.class", - "CalendarData_ne_IN.class", "CalendarData_ne_NP.class", "CalendarData_nl_AW.class", - "CalendarData_nl_BE.class", "CalendarData_nl_BQ.class", "CalendarData_nl_CW.class", - "CalendarData_nl_NL.class", "CalendarData_nl_SR.class", "CalendarData_nl_SX.class", - "CalendarData_nmg_CM.class", "CalendarData_nnh_CM.class", "CalendarData_nus_SS.class", - "CalendarData_nyn_UG.class", "CalendarData_om_ET.class", "CalendarData_om_KE.class", - "CalendarData_or_IN.class", "CalendarData_os_GE.class", "CalendarData_os_RU.class", - "CalendarData_pa_Arab_PK.class", "CalendarData_pa_IN.class", "CalendarData_pa_PK.class", - "CalendarData_pl_PL.class", "CalendarData_ps_AF.class", "CalendarData_pt_AO.class", - "CalendarData_pt_BR.class", "CalendarData_pt_CV.class", "CalendarData_pt_GQ.class", - "CalendarData_pt_GW.class", "CalendarData_pt_MO.class", "CalendarData_pt_MZ.class", - "CalendarData_pt_PT.class", "CalendarData_pt_ST.class", "CalendarData_pt_TL.class", - "CalendarData_qu_BO.class", "CalendarData_qu_EC.class", "CalendarData_qu_PE.class", - "CalendarData_rm_CH.class", "CalendarData_rn_BI.class", "CalendarData_ro_MD.class", - "CalendarData_ro_RO.class", "CalendarData_rof_TZ.class", "CalendarData_ru_BY.class", - "CalendarData_ru_KG.class", "CalendarData_ru_KZ.class", "CalendarData_ru_MD.class", - "CalendarData_ru_RU.class", "CalendarData_ru_UA.class", "CalendarData_rw_RW.class", - "CalendarData_rwk_TZ.class", "CalendarData_sah_RU.class", "CalendarData_saq_KE.class", - "CalendarData_sbp_TZ.class", "CalendarData_se_FI.class", "CalendarData_se_NO.class", - "CalendarData_se_SE.class", "CalendarData_seh_MZ.class", "CalendarData_ses_ML.class", - "CalendarData_sg_CF.class", "CalendarData_shi_Latn_MA.class", "CalendarData_shi_MA.class", - "CalendarData_si_LK.class", "CalendarData_sk_SK.class", "CalendarData_sl_SI.class", - "CalendarData_smn_FI.class", "CalendarData_sn_ZW.class", "CalendarData_so_DJ.class", - "CalendarData_so_ET.class", "CalendarData_so_KE.class", "CalendarData_so_SO.class", - "CalendarData_sq_AL.class", "CalendarData_sq_MK.class", "CalendarData_sq_XK.class", - "CalendarData_sr_BA.class", "CalendarData_sr_Latn_BA.class", "CalendarData_sr_Latn_ME.class", - "CalendarData_sr_Latn_RS.class", "CalendarData_sr_Latn_XK.class", "CalendarData_sr_ME.class", - "CalendarData_sr_RS.class", "CalendarData_sr_XK.class", "CalendarData_sv_AX.class", - "CalendarData_sv_FI.class", "CalendarData_sv_SE.class", "CalendarData_sw_CD.class", - "CalendarData_sw_KE.class", "CalendarData_sw_TZ.class", "CalendarData_sw_UG.class", - "CalendarData_ta_IN.class", "CalendarData_ta_LK.class", "CalendarData_ta_MY.class", - "CalendarData_ta_SG.class", "CalendarData_te_IN.class", "CalendarData_teo_KE.class", - "CalendarData_teo_UG.class", "CalendarData_th_TH.class", "CalendarData_ti_ER.class", - "CalendarData_ti_ET.class", "CalendarData_tk_TM.class", "CalendarData_to_TO.class", - "CalendarData_tr_CY.class", "CalendarData_tr_TR.class", "CalendarData_twq_NE.class", - "CalendarData_tzm_MA.class", "CalendarData_ug_CN.class", "CalendarData_uk_UA.class", - "CalendarData_ur_IN.class", "CalendarData_ur_PK.class", "CalendarData_uz_AF.class", - "CalendarData_uz_Arab_AF.class", "CalendarData_uz_Cyrl_UZ.class", "CalendarData_uz_UZ.class", - "CalendarData_vai_LR.class", "CalendarData_vai_Latn_LR.class", "CalendarData_vi_VN.class", - "CalendarData_vun_TZ.class", "CalendarData_wae_CH.class", "CalendarData_xog_UG.class", - "CalendarData_yav_CM.class", "CalendarData_yo_BJ.class", "CalendarData_yo_NG.class", - "CalendarData_yue_HK.class", "CalendarData_zgh_MA.class", "CalendarData_zh_CN.class", - "CalendarData_zh_HK.class", "CalendarData_zh_Hant_HK.class", "CalendarData_zh_Hant_TW.class", - "CalendarData_zh_MO.class", "CalendarData_zh_SG.class", "CalendarData_zh_TW.class", "CalendarData_zu_ZA.class"); - - private static Set removedBundles = Set.of( - "CalendarData_az_Latn_AZ.class", "CalendarData_bs_Latn_BA.class", - "CalendarData_pa_Guru_IN.class", "CalendarData_shi_Tfng_MA.class", - "CalendarData_sr_Cyrl_BA.class", "CalendarData_sr_Cyrl_ME.class", - "CalendarData_sr_Cyrl_RS.class", "CalendarData_sr_Cyrl_XK.class", - "CalendarData_uz_Latn_UZ.class", "CalendarData_vai_Vaii_LR.class", - "CalendarData_zh_Hans_CN.class", "CalendarData_zh_Hans_HK.class", - "CalendarData_zh_Hans_MO.class", "CalendarData_zh_Hans_SG.class"); - - private static Set addedBundles = Set.of( - "CalendarData_az_AZ.class", "CalendarData_bs_BA.class", - "CalendarData_pa_IN.class", "CalendarData_pa_PK.class", - "CalendarData_shi_MA.class", "CalendarData_sr_BA.class", - "CalendarData_sr_ME.class", "CalendarData_sr_RS.class", - "CalendarData_sr_XK.class", "CalendarData_uz_UZ.class", - "CalendarData_uz_AF.class", "CalendarData_vai_LR.class", - "CalendarData_zh_CN.class", "CalendarData_zh_HK.class", - "CalendarData_zh_MO.class", "CalendarData_zh_SG.class", "CalendarData_zh_TW.class"); - - private static Set retrievedBundles = Collections.EMPTY_SET; - - public static void main(String[] args) throws Exception { - FileSystem fs = FileSystems.newFileSystem(URI.create("jrt:/"), - Collections.emptyMap()); - Path path = fs.getPath("/", "modules", "jdk.localedata", "sun/util/resources/cldr/ext"); - retrievedBundles = Files.walk(path) - .map(p -> p.getFileName().toString()) - .filter(p -> p.startsWith("CalendarData_")) - .collect(Collectors.toSet()); - if (!retrievedBundles.equals(expectedBundles)) { - checkAddedBundles(); - checkRemovedBundles(); - Set retrievedBundlesSet = new HashSet<>(retrievedBundles); - retrievedBundlesSet.removeAll(expectedBundles); - throw new RuntimeException("Unexpected " - + " bundles " + retrievedBundlesSet + " are present in jdk.localedata module "); - - } - } - - /** - * This method checks that bundles which have been additionally generated - * are present in jdk.localedata module. - */ - private static void checkAddedBundles() { - Set addedBundlesSet = new HashSet<>(addedBundles); - addedBundlesSet.removeAll(retrievedBundles); - if (!addedBundlesSet.isEmpty()) { - throw new RuntimeException("expected CalendarData" - + " bundles " + addedBundlesSet + " are not present in jdk.localedata module "); - } - - } - - /** - * This method checks that bundles which have been removed are not present - * in jdk.localedata module. - */ - private static void checkRemovedBundles() { - Set unexpectedBundles = removedBundles.stream(). - filter(retrievedBundles::contains).collect(Collectors.toSet()); - if (!unexpectedBundles.isEmpty()) { - throw new RuntimeException("Unexpected CalendarData" - + " bundles " + unexpectedBundles + " are present in jdk.localedata module "); - } - } -} diff --git a/test/jdk/java/time/test/java/time/format/TestUnicodeExtension.java b/test/jdk/java/time/test/java/time/format/TestUnicodeExtension.java new file mode 100644 index 00000000000..18768c8f01e --- /dev/null +++ b/test/jdk/java/time/test/java/time/format/TestUnicodeExtension.java @@ -0,0 +1,852 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8176841 + * @summary Tests java.time classes deals with Unicode extensions + * correctly. + * @modules jdk.localedata + */ +package test.java.time.format; + +import static org.testng.Assert.assertEquals; + +import java.time.DayOfWeek; +import java.time.ZonedDateTime; +import java.time.ZoneId; +import java.time.chrono.Chronology; +import java.time.chrono.HijrahChronology; +import java.time.chrono.IsoChronology; +import java.time.chrono.JapaneseChronology; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeFormatterBuilder; +import java.time.format.FormatStyle; +import java.time.temporal.ChronoField; +import java.time.temporal.TemporalField; +import java.time.temporal.WeekFields; +import java.util.Locale; +import java.util.TimeZone; + +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +/** + * Test JavaTime with BCP47 U extensions + */ +@Test +public class TestUnicodeExtension { + private static TimeZone defaultTZ; + + private static final Chronology JAPANESE = JapaneseChronology.INSTANCE; + private static final Chronology HIJRAH = HijrahChronology.INSTANCE; + + private static final ZoneId ASIATOKYO = ZoneId.of("Asia/Tokyo"); + private static final ZoneId AMLA = ZoneId.of("America/Los_Angeles"); + + private static final Locale JPTYO = Locale.forLanguageTag("en-u-tz-jptyo"); + private static final Locale JCAL = Locale.forLanguageTag("en-u-ca-japanese"); + private static final Locale HCAL = Locale.forLanguageTag("en-u-ca-islamic-umalqura"); + + private static final Locale FW_SUN = Locale.forLanguageTag("en-US-u-fw-sun"); + private static final Locale FW_MON = Locale.forLanguageTag("en-US-u-fw-mon"); + private static final Locale FW_TUE = Locale.forLanguageTag("en-US-u-fw-tue"); + private static final Locale FW_WED = Locale.forLanguageTag("en-US-u-fw-wed"); + private static final Locale FW_THU = Locale.forLanguageTag("en-US-u-fw-thu"); + private static final Locale FW_FRI = Locale.forLanguageTag("en-US-u-fw-fri"); + private static final Locale FW_SAT = Locale.forLanguageTag("en-US-u-fw-sat"); + + private static final Locale RG_GB = Locale.forLanguageTag("en-US-u-rg-gbzzzz"); + + private static final ZonedDateTime ZDT = ZonedDateTime.of(2017, 8, 10, 15, 15, 0, 0, AMLA); + + private static final String PATTERN = "GGGG MMMM-dd-uu HH:mm:ss zzzz"; + + @BeforeTest + public void beforeTest() { + defaultTZ = TimeZone.getDefault(); + TimeZone.setDefault(TimeZone.getTimeZone(AMLA)); + } + + @AfterTest + public void afterTest() { + TimeZone.setDefault(defaultTZ); + } + + @DataProvider(name="localizedBy") + Object[][] localizedBy() { + return new Object[][] { + // Locale, Chrono override, Zone override, Expected Chrono, Expected Zone, + // Expected formatted string + {Locale.JAPAN, null, null, null, null, + "2017\u5e748\u670810\u65e5\u6728\u66dc\u65e5 15\u664215\u520600\u79d2 \u30a2\u30e1\u30ea\u30ab\u592a\u5e73\u6d0b\u590f\u6642\u9593" + }, + {Locale.JAPAN, JAPANESE, null, JAPANESE, null, + "\u5e73\u621029\u5e748\u670810\u65e5\u6728\u66dc\u65e5 15\u664215\u520600\u79d2 \u30a2\u30e1\u30ea\u30ab\u592a\u5e73\u6d0b\u590f\u6642\u9593" + }, + {Locale.JAPAN, JAPANESE, ASIATOKYO, JAPANESE, ASIATOKYO, + "\u5e73\u621029\u5e748\u670811\u65e5\u91d1\u66dc\u65e5 7\u664215\u520600\u79d2 \u65e5\u672c\u6a19\u6e96\u6642" + }, + + {JCAL, null, null, JAPANESE, null, + "Thursday, August 10, 29 Heisei at 3:15:00 PM Pacific Daylight Time" + }, + {JCAL, HIJRAH, null, JAPANESE, null, + "Thursday, August 10, 29 Heisei at 3:15:00 PM Pacific Daylight Time" + }, + {HCAL, JAPANESE, null, HIJRAH, null, + "Thursday, Dhu\u02bbl-Qi\u02bbdah 18, 1438 AH at 3:15:00 PM Pacific Daylight Time" + }, + + + {JPTYO, null, null, null, ASIATOKYO, + "Friday, August 11, 2017 at 7:15:00 AM Japan Standard Time" + }, + {JPTYO, null, AMLA, null, ASIATOKYO, + "Friday, August 11, 2017 at 7:15:00 AM Japan Standard Time" + }, + // invalid tz + {Locale.forLanguageTag("en-US-u-tz-jpzzz"), null, null, null, null, + "Thursday, August 10, 2017 at 3:15:00 PM Pacific Daylight Time" + }, + {Locale.forLanguageTag("en-US-u-tz-jpzzz"), null, AMLA, null, AMLA, + "Thursday, August 10, 2017 at 3:15:00 PM Pacific Daylight Time" + }, + + {RG_GB, null, null, null, null, + "Thursday, 10 August 2017 at 15:15:00 Pacific Daylight Time" + }, + + // DecimalStyle + {Locale.forLanguageTag("en-US-u-nu-thai"), null, null, null, null, + "Thursday, August \u0e51\u0e50, \u0e52\u0e50\u0e51\u0e57 at \u0e53:\u0e51\u0e55:\u0e50\u0e50 PM Pacific Daylight Time" + }, + // DecimalStyle, "nu" vs "rg" + {Locale.forLanguageTag("en-US-u-nu-thai-rg-uszzzz"), null, null, null, null, + "Thursday, August \u0e51\u0e50, \u0e52\u0e50\u0e51\u0e57 at \u0e53:\u0e51\u0e55:\u0e50\u0e50 PM Pacific Daylight Time" + }, + // DecimalStyle, invalid + {Locale.forLanguageTag("en-US-u-nu-foo"), null, null, null, null, + "Thursday, August 10, 2017 at 3:15:00 PM Pacific Daylight Time" + }, + }; + } + + @DataProvider(name="withLocale") + Object[][] withLocale() { + return new Object[][] { + // Locale, Chrono override, Zone override, Expected Chrono, Expected Zone, + // Expected formatted string + {Locale.JAPAN, null, null, null, null, + "2017\u5e748\u670810\u65e5\u6728\u66dc\u65e5 15\u664215\u520600\u79d2 \u30a2\u30e1\u30ea\u30ab\u592a\u5e73\u6d0b\u590f\u6642\u9593" + }, + {Locale.JAPAN, JAPANESE, null, JAPANESE, null, + "\u5e73\u621029\u5e748\u670810\u65e5\u6728\u66dc\u65e5 15\u664215\u520600\u79d2 \u30a2\u30e1\u30ea\u30ab\u592a\u5e73\u6d0b\u590f\u6642\u9593" + }, + {Locale.JAPAN, JAPANESE, ASIATOKYO, JAPANESE, ASIATOKYO, + "\u5e73\u621029\u5e748\u670811\u65e5\u91d1\u66dc\u65e5 7\u664215\u520600\u79d2 \u65e5\u672c\u6a19\u6e96\u6642" + }, + + {JCAL, null, null, null, null, + "Thursday, August 10, 2017 at 3:15:00 PM Pacific Daylight Time" + }, + {JCAL, HIJRAH, null, HIJRAH, null, + "Thursday, Dhu\u02bbl-Qi\u02bbdah 18, 1438 AH at 3:15:00 PM Pacific Daylight Time" + }, + {HCAL, JAPANESE, null, JAPANESE, null, + "Thursday, August 10, 29 Heisei at 3:15:00 PM Pacific Daylight Time" + }, + + + {JPTYO, null, null, null, null, + "Thursday, August 10, 2017 at 3:15:00 PM Pacific Daylight Time" + }, + {JPTYO, null, AMLA, null, AMLA, + "Thursday, August 10, 2017 at 3:15:00 PM Pacific Daylight Time" + }, + // invalid tz + {Locale.forLanguageTag("en-US-u-tz-jpzzz"), null, null, null, null, + "Thursday, August 10, 2017 at 3:15:00 PM Pacific Daylight Time" + }, + {Locale.forLanguageTag("en-US-u-tz-jpzzz"), null, null, null, null, + "Thursday, August 10, 2017 at 3:15:00 PM Pacific Daylight Time" + }, + + {RG_GB, null, null, null, null, + "Thursday, 10 August 2017 at 15:15:00 Pacific Daylight Time" + }, + + // DecimalStyle + {Locale.forLanguageTag("en-US-u-nu-thai"), null, null, null, null, + "Thursday, August 10, 2017 at 3:15:00 PM Pacific Daylight Time" + }, + // DecimalStyle, "nu" vs "rg" + {Locale.forLanguageTag("en-US-u-nu-thai-rg-uszzzz"), null, null, null, null, + "Thursday, August 10, 2017 at 3:15:00 PM Pacific Daylight Time" + }, + // DecimalStyle, invalid + {Locale.forLanguageTag("en-US-u-nu-foo"), null, null, null, null, + "Thursday, August 10, 2017 at 3:15:00 PM Pacific Daylight Time" + }, + }; + } + + @DataProvider(name="firstDayOfWeek") + Object[][] firstDayOfWeek () { + return new Object[][] { + // Locale, Expected DayOfWeek, + {Locale.US, DayOfWeek.SUNDAY}, + {FW_SUN, DayOfWeek.SUNDAY}, + {FW_MON, DayOfWeek.MONDAY}, + {FW_TUE, DayOfWeek.TUESDAY}, + {FW_WED, DayOfWeek.WEDNESDAY}, + {FW_THU, DayOfWeek.THURSDAY}, + {FW_FRI, DayOfWeek.FRIDAY}, + {FW_SAT, DayOfWeek.SATURDAY}, + + // invalid case + {Locale.forLanguageTag("en-US-u-fw-xxx"), DayOfWeek.SUNDAY}, + + // region override + {RG_GB, DayOfWeek.MONDAY}, + {Locale.forLanguageTag("zh-CN-u-rg-eszzzz"), DayOfWeek.MONDAY}, + + // "fw" and "rg". + {Locale.forLanguageTag("en-US-u-fw-wed-rg-gbzzzz"), DayOfWeek.WEDNESDAY}, + {Locale.forLanguageTag("en-US-u-fw-xxx-rg-gbzzzz"), DayOfWeek.MONDAY}, + {Locale.forLanguageTag("en-US-u-fw-xxx-rg-zzzz"), DayOfWeek.SUNDAY}, + }; + } + + @DataProvider(name="minDaysInFirstWeek") + Object[][] minDaysInFrstWeek () { + return new Object[][] { + // Locale, Expected minDay, + {Locale.US, 1}, + + // region override + {RG_GB, 4}, + {Locale.forLanguageTag("zh-CN-u-rg-eszzzz"), 4}, + }; + } + + @DataProvider(name="ofPattern") + Object[][] ofPattern() { + return new Object[][] { + // Locale, Expected Chrono, Expected Zone, + // Expected formatted string + {JCAL, null, null, + "Anno Domini August-10-17 15:15:00 Pacific Daylight Time" + }, + {HCAL, null, null, + "Anno Domini August-10-17 15:15:00 Pacific Daylight Time" + }, + + {JPTYO, null, null, + "Anno Domini August-10-17 15:15:00 Pacific Daylight Time" + }, + {Locale.forLanguageTag("en-US-u-tz-jpzzz"), null, null, + "Anno Domini August-10-17 15:15:00 Pacific Daylight Time" + }, + + {RG_GB, null, null, + "Anno Domini August-10-17 15:15:00 Pacific Daylight Time" + }, + + }; + } + + @DataProvider(name="shortTZID") + Object[][] shortTZID() { + return new Object[][] { + // LDML's short ID, Expected Zone, + {"adalv", "Europe/Andorra"}, + {"aedxb", "Asia/Dubai"}, + {"afkbl", "Asia/Kabul"}, + {"aganu", "America/Antigua"}, + {"aiaxa", "America/Anguilla"}, + {"altia", "Europe/Tirane"}, + {"amevn", "Asia/Yerevan"}, + {"ancur", "America/Curacao"}, + {"aolad", "Africa/Luanda"}, + {"aqcas", "Antarctica/Casey"}, + {"aqdav", "Antarctica/Davis"}, + {"aqddu", "Antarctica/DumontDUrville"}, + {"aqmaw", "Antarctica/Mawson"}, + {"aqmcm", "Antarctica/McMurdo"}, + {"aqplm", "Antarctica/Palmer"}, + {"aqrot", "Antarctica/Rothera"}, + {"aqsyw", "Antarctica/Syowa"}, + {"aqtrl", "Antarctica/Troll"}, + {"aqvos", "Antarctica/Vostok"}, + {"arbue", "America/Buenos_Aires"}, + {"arcor", "America/Cordoba"}, + {"arctc", "America/Catamarca"}, + {"arirj", "America/Argentina/La_Rioja"}, + {"arjuj", "America/Jujuy"}, + {"arluq", "America/Argentina/San_Luis"}, + {"armdz", "America/Mendoza"}, + {"arrgl", "America/Argentina/Rio_Gallegos"}, + {"arsla", "America/Argentina/Salta"}, + {"artuc", "America/Argentina/Tucuman"}, + {"aruaq", "America/Argentina/San_Juan"}, + {"arush", "America/Argentina/Ushuaia"}, + {"asppg", "Pacific/Pago_Pago"}, + {"atvie", "Europe/Vienna"}, + {"auadl", "Australia/Adelaide"}, + {"aubhq", "Australia/Broken_Hill"}, + {"aubne", "Australia/Brisbane"}, + {"audrw", "Australia/Darwin"}, + {"aueuc", "Australia/Eucla"}, + {"auhba", "Australia/Hobart"}, + {"aukns", "Australia/Currie"}, + {"auldc", "Australia/Lindeman"}, + {"auldh", "Australia/Lord_Howe"}, + {"aumel", "Australia/Melbourne"}, + {"aumqi", "Antarctica/Macquarie"}, + {"auper", "Australia/Perth"}, + {"ausyd", "Australia/Sydney"}, + {"awaua", "America/Aruba"}, + {"azbak", "Asia/Baku"}, + {"basjj", "Europe/Sarajevo"}, + {"bbbgi", "America/Barbados"}, + {"bddac", "Asia/Dhaka"}, + {"bebru", "Europe/Brussels"}, + {"bfoua", "Africa/Ouagadougou"}, + {"bgsof", "Europe/Sofia"}, + {"bhbah", "Asia/Bahrain"}, + {"bibjm", "Africa/Bujumbura"}, + {"bjptn", "Africa/Porto-Novo"}, + {"bmbda", "Atlantic/Bermuda"}, + {"bnbwn", "Asia/Brunei"}, + {"bolpb", "America/La_Paz"}, + {"bqkra", "America/Kralendijk"}, + {"braux", "America/Araguaina"}, + {"brbel", "America/Belem"}, + {"brbvb", "America/Boa_Vista"}, + {"brcgb", "America/Cuiaba"}, + {"brcgr", "America/Campo_Grande"}, + {"brern", "America/Eirunepe"}, + {"brfen", "America/Noronha"}, + {"brfor", "America/Fortaleza"}, + {"brmao", "America/Manaus"}, + {"brmcz", "America/Maceio"}, + {"brpvh", "America/Porto_Velho"}, + {"brrbr", "America/Rio_Branco"}, + {"brrec", "America/Recife"}, + {"brsao", "America/Sao_Paulo"}, + {"brssa", "America/Bahia"}, + {"brstm", "America/Santarem"}, + {"bsnas", "America/Nassau"}, + {"btthi", "Asia/Thimphu"}, + {"bwgbe", "Africa/Gaborone"}, + {"bymsq", "Europe/Minsk"}, + {"bzbze", "America/Belize"}, + {"cacfq", "America/Creston"}, + {"caedm", "America/Edmonton"}, + {"caffs", "America/Rainy_River"}, + {"cafne", "America/Fort_Nelson"}, + {"caglb", "America/Glace_Bay"}, + {"cagoo", "America/Goose_Bay"}, + {"cahal", "America/Halifax"}, + {"caiql", "America/Iqaluit"}, + {"camon", "America/Moncton"}, + {"capnt", "America/Pangnirtung"}, + {"careb", "America/Resolute"}, + {"careg", "America/Regina"}, + {"casjf", "America/St_Johns"}, + {"canpg", "America/Nipigon"}, + {"cathu", "America/Thunder_Bay"}, + {"cator", "America/Toronto"}, + {"cavan", "America/Vancouver"}, + {"cawnp", "America/Winnipeg"}, + {"caybx", "America/Blanc-Sablon"}, + {"caycb", "America/Cambridge_Bay"}, + {"cayda", "America/Dawson"}, + {"caydq", "America/Dawson_Creek"}, + {"cayek", "America/Rankin_Inlet"}, + {"cayev", "America/Inuvik"}, + {"cayxy", "America/Whitehorse"}, + {"cayyn", "America/Swift_Current"}, + {"cayzf", "America/Yellowknife"}, + {"cayzs", "America/Coral_Harbour"}, + {"cccck", "Indian/Cocos"}, + {"cdfbm", "Africa/Lubumbashi"}, + {"cdfih", "Africa/Kinshasa"}, + {"cfbgf", "Africa/Bangui"}, + {"cgbzv", "Africa/Brazzaville"}, + {"chzrh", "Europe/Zurich"}, + {"ciabj", "Africa/Abidjan"}, + {"ckrar", "Pacific/Rarotonga"}, + {"clipc", "Pacific/Easter"}, + {"clscl", "America/Santiago"}, + {"cmdla", "Africa/Douala"}, + {"cnsha", "Asia/Shanghai"}, + {"cnurc", "Asia/Urumqi"}, + {"cobog", "America/Bogota"}, + {"crsjo", "America/Costa_Rica"}, + {"cst6cdt", "CST6CDT"}, + {"cuhav", "America/Havana"}, + {"cvrai", "Atlantic/Cape_Verde"}, + {"cxxch", "Indian/Christmas"}, + {"cynic", "Asia/Nicosia"}, + {"czprg", "Europe/Prague"}, + {"deber", "Europe/Berlin"}, + {"debsngn", "Europe/Busingen"}, + {"djjib", "Africa/Djibouti"}, + {"dkcph", "Europe/Copenhagen"}, + {"dmdom", "America/Dominica"}, + {"dosdq", "America/Santo_Domingo"}, + {"dzalg", "Africa/Algiers"}, + {"ecgps", "Pacific/Galapagos"}, + {"ecgye", "America/Guayaquil"}, + {"eetll", "Europe/Tallinn"}, + {"egcai", "Africa/Cairo"}, + {"eheai", "Africa/El_Aaiun"}, + {"erasm", "Africa/Asmera"}, + {"esceu", "Africa/Ceuta"}, + {"eslpa", "Atlantic/Canary"}, + {"esmad", "Europe/Madrid"}, + {"est5edt", "EST5EDT"}, + {"etadd", "Africa/Addis_Ababa"}, + {"fihel", "Europe/Helsinki"}, + {"fimhq", "Europe/Mariehamn"}, + {"fjsuv", "Pacific/Fiji"}, + {"fkpsy", "Atlantic/Stanley"}, + {"fmksa", "Pacific/Kosrae"}, + {"fmpni", "Pacific/Ponape"}, + {"fmtkk", "Pacific/Truk"}, + {"fotho", "Atlantic/Faeroe"}, + {"frpar", "Europe/Paris"}, + {"galbv", "Africa/Libreville"}, + {"gaza", "Asia/Gaza"}, + {"gblon", "Europe/London"}, + {"gdgnd", "America/Grenada"}, + {"getbs", "Asia/Tbilisi"}, + {"gfcay", "America/Cayenne"}, + {"gggci", "Europe/Guernsey"}, + {"ghacc", "Africa/Accra"}, + {"gigib", "Europe/Gibraltar"}, + {"gldkshvn", "America/Danmarkshavn"}, + {"glgoh", "America/Godthab"}, + {"globy", "America/Scoresbysund"}, + {"glthu", "America/Thule"}, + {"gmbjl", "Africa/Banjul"}, + {"gncky", "Africa/Conakry"}, + {"gpbbr", "America/Guadeloupe"}, + {"gpmsb", "America/Marigot"}, + {"gpsbh", "America/St_Barthelemy"}, + {"gqssg", "Africa/Malabo"}, + {"grath", "Europe/Athens"}, + {"gsgrv", "Atlantic/South_Georgia"}, + {"gtgua", "America/Guatemala"}, + {"gugum", "Pacific/Guam"}, + {"gwoxb", "Africa/Bissau"}, + {"gygeo", "America/Guyana"}, + {"hebron", "Asia/Hebron"}, + {"hkhkg", "Asia/Hong_Kong"}, + {"hntgu", "America/Tegucigalpa"}, + {"hrzag", "Europe/Zagreb"}, + {"htpap", "America/Port-au-Prince"}, + {"hubud", "Europe/Budapest"}, + {"iddjj", "Asia/Jayapura"}, + {"idjkt", "Asia/Jakarta"}, + {"idmak", "Asia/Makassar"}, + {"idpnk", "Asia/Pontianak"}, + {"iedub", "Europe/Dublin"}, + {"imdgs", "Europe/Isle_of_Man"}, + {"inccu", "Asia/Calcutta"}, + {"iodga", "Indian/Chagos"}, + {"iqbgw", "Asia/Baghdad"}, + {"irthr", "Asia/Tehran"}, + {"isrey", "Atlantic/Reykjavik"}, + {"itrom", "Europe/Rome"}, + {"jeruslm", "Asia/Jerusalem"}, + {"jesth", "Europe/Jersey"}, + {"jmkin", "America/Jamaica"}, + {"joamm", "Asia/Amman"}, + {"jptyo", "Asia/Tokyo"}, + {"kenbo", "Africa/Nairobi"}, + {"kgfru", "Asia/Bishkek"}, + {"khpnh", "Asia/Phnom_Penh"}, + {"kicxi", "Pacific/Kiritimati"}, + {"kipho", "Pacific/Enderbury"}, + {"kitrw", "Pacific/Tarawa"}, + {"kmyva", "Indian/Comoro"}, + {"knbas", "America/St_Kitts"}, + {"kpfnj", "Asia/Pyongyang"}, + {"krsel", "Asia/Seoul"}, + {"kwkwi", "Asia/Kuwait"}, + {"kygec", "America/Cayman"}, + {"kzaau", "Asia/Aqtau"}, + {"kzakx", "Asia/Aqtobe"}, + {"kzala", "Asia/Almaty"}, + {"kzkzo", "Asia/Qyzylorda"}, + {"kzura", "Asia/Oral"}, + {"lavte", "Asia/Vientiane"}, + {"lbbey", "Asia/Beirut"}, + {"lccas", "America/St_Lucia"}, + {"livdz", "Europe/Vaduz"}, + {"lkcmb", "Asia/Colombo"}, + {"lrmlw", "Africa/Monrovia"}, + {"lsmsu", "Africa/Maseru"}, + {"ltvno", "Europe/Vilnius"}, + {"lulux", "Europe/Luxembourg"}, + {"lvrix", "Europe/Riga"}, + {"lytip", "Africa/Tripoli"}, + {"macas", "Africa/Casablanca"}, + {"mcmon", "Europe/Monaco"}, + {"mdkiv", "Europe/Chisinau"}, + {"metgd", "Europe/Podgorica"}, + {"mgtnr", "Indian/Antananarivo"}, + {"mhkwa", "Pacific/Kwajalein"}, + {"mhmaj", "Pacific/Majuro"}, + {"mkskp", "Europe/Skopje"}, + {"mlbko", "Africa/Bamako"}, + {"mmrgn", "Asia/Rangoon"}, + {"mncoq", "Asia/Choibalsan"}, + {"mnhvd", "Asia/Hovd"}, + {"mnuln", "Asia/Ulaanbaatar"}, + {"momfm", "Asia/Macau"}, + {"mpspn", "Pacific/Saipan"}, + {"mqfdf", "America/Martinique"}, + {"mrnkc", "Africa/Nouakchott"}, + {"msmni", "America/Montserrat"}, + {"mst7mdt", "MST7MDT"}, + {"mtmla", "Europe/Malta"}, + {"muplu", "Indian/Mauritius"}, + {"mvmle", "Indian/Maldives"}, + {"mwblz", "Africa/Blantyre"}, + {"mxchi", "America/Chihuahua"}, + {"mxcun", "America/Cancun"}, + {"mxhmo", "America/Hermosillo"}, + {"mxmam", "America/Matamoros"}, + {"mxmex", "America/Mexico_City"}, + {"mxmid", "America/Merida"}, + {"mxmty", "America/Monterrey"}, + {"mxmzt", "America/Mazatlan"}, + {"mxoji", "America/Ojinaga"}, + {"mxpvr", "America/Bahia_Banderas"}, + {"mxstis", "America/Santa_Isabel"}, + {"mxtij", "America/Tijuana"}, + {"mykch", "Asia/Kuching"}, + {"mykul", "Asia/Kuala_Lumpur"}, + {"mzmpm", "Africa/Maputo"}, + {"nawdh", "Africa/Windhoek"}, + {"ncnou", "Pacific/Noumea"}, + {"nenim", "Africa/Niamey"}, + {"nfnlk", "Pacific/Norfolk"}, + {"nglos", "Africa/Lagos"}, + {"nimga", "America/Managua"}, + {"nlams", "Europe/Amsterdam"}, + {"noosl", "Europe/Oslo"}, + {"npktm", "Asia/Katmandu"}, + {"nrinu", "Pacific/Nauru"}, + {"nuiue", "Pacific/Niue"}, + {"nzakl", "Pacific/Auckland"}, + {"nzcht", "Pacific/Chatham"}, + {"ommct", "Asia/Muscat"}, + {"papty", "America/Panama"}, + {"pelim", "America/Lima"}, + {"pfgmr", "Pacific/Gambier"}, + {"pfnhv", "Pacific/Marquesas"}, + {"pfppt", "Pacific/Tahiti"}, + {"pgpom", "Pacific/Port_Moresby"}, + {"pgraw", "Pacific/Bougainville"}, + {"phmnl", "Asia/Manila"}, + {"pkkhi", "Asia/Karachi"}, + {"plwaw", "Europe/Warsaw"}, + {"pmmqc", "America/Miquelon"}, + {"pnpcn", "Pacific/Pitcairn"}, + {"prsju", "America/Puerto_Rico"}, + {"pst8pdt", "PST8PDT"}, + {"ptfnc", "Atlantic/Madeira"}, + {"ptlis", "Europe/Lisbon"}, + {"ptpdl", "Atlantic/Azores"}, + {"pwror", "Pacific/Palau"}, + {"pyasu", "America/Asuncion"}, + {"qadoh", "Asia/Qatar"}, + {"rereu", "Indian/Reunion"}, + {"robuh", "Europe/Bucharest"}, + {"rsbeg", "Europe/Belgrade"}, + {"ruchita", "Asia/Chita"}, + {"rudyr", "Asia/Anadyr"}, + {"rugdx", "Asia/Magadan"}, + {"ruikt", "Asia/Irkutsk"}, + {"rukgd", "Europe/Kaliningrad"}, + {"rukhndg", "Asia/Khandyga"}, + {"rukra", "Asia/Krasnoyarsk"}, + {"rukuf", "Europe/Samara"}, + {"rumow", "Europe/Moscow"}, + {"runoz", "Asia/Novokuznetsk"}, + {"ruoms", "Asia/Omsk"}, + {"ruovb", "Asia/Novosibirsk"}, + {"rupkc", "Asia/Kamchatka"}, + {"rusred", "Asia/Srednekolymsk"}, + {"ruunera", "Asia/Ust-Nera"}, + {"ruuus", "Asia/Sakhalin"}, + {"ruvog", "Europe/Volgograd"}, + {"ruvvo", "Asia/Vladivostok"}, + {"ruyek", "Asia/Yekaterinburg"}, + {"ruyks", "Asia/Yakutsk"}, + {"rwkgl", "Africa/Kigali"}, + {"saruh", "Asia/Riyadh"}, + {"sbhir", "Pacific/Guadalcanal"}, + {"scmaw", "Indian/Mahe"}, + {"sdkrt", "Africa/Khartoum"}, + {"sesto", "Europe/Stockholm"}, + {"sgsin", "Asia/Singapore"}, + {"shshn", "Atlantic/St_Helena"}, + {"silju", "Europe/Ljubljana"}, + {"sjlyr", "Arctic/Longyearbyen"}, + {"skbts", "Europe/Bratislava"}, + {"slfna", "Africa/Freetown"}, + {"smsai", "Europe/San_Marino"}, + {"sndkr", "Africa/Dakar"}, + {"somgq", "Africa/Mogadishu"}, + {"srpbm", "America/Paramaribo"}, + {"ssjub", "Africa/Juba"}, + {"sttms", "Africa/Sao_Tome"}, + {"svsal", "America/El_Salvador"}, + {"sxphi", "America/Lower_Princes"}, + {"sydam", "Asia/Damascus"}, + {"szqmn", "Africa/Mbabane"}, + {"tcgdt", "America/Grand_Turk"}, + {"tdndj", "Africa/Ndjamena"}, + {"tfpfr", "Indian/Kerguelen"}, + {"tglfw", "Africa/Lome"}, + {"thbkk", "Asia/Bangkok"}, + {"tjdyu", "Asia/Dushanbe"}, + {"tkfko", "Pacific/Fakaofo"}, + {"tldil", "Asia/Dili"}, + {"tmasb", "Asia/Ashgabat"}, + {"tntun", "Africa/Tunis"}, + {"totbu", "Pacific/Tongatapu"}, + {"trist", "Europe/Istanbul"}, + {"ttpos", "America/Port_of_Spain"}, + {"tvfun", "Pacific/Funafuti"}, + {"twtpe", "Asia/Taipei"}, + {"tzdar", "Africa/Dar_es_Salaam"}, + {"uaiev", "Europe/Kiev"}, + {"uaozh", "Europe/Zaporozhye"}, + {"uasip", "Europe/Simferopol"}, + {"uauzh", "Europe/Uzhgorod"}, + {"ugkla", "Africa/Kampala"}, + {"umawk", "Pacific/Wake"}, + {"umjon", "Pacific/Johnston"}, + {"ummdy", "Pacific/Midway"}, +// {"unk", "Etc/Unknown"}, + {"usadk", "America/Adak"}, + {"usaeg", "America/Indiana/Marengo"}, + {"usanc", "America/Anchorage"}, + {"usboi", "America/Boise"}, + {"uschi", "America/Chicago"}, + {"usden", "America/Denver"}, + {"usdet", "America/Detroit"}, + {"ushnl", "Pacific/Honolulu"}, + {"usind", "America/Indianapolis"}, + {"usinvev", "America/Indiana/Vevay"}, + {"usjnu", "America/Juneau"}, + {"usknx", "America/Indiana/Knox"}, + {"uslax", "America/Los_Angeles"}, + {"uslui", "America/Louisville"}, + {"usmnm", "America/Menominee"}, + {"usmtm", "America/Metlakatla"}, + {"usmoc", "America/Kentucky/Monticello"}, + {"usndcnt", "America/North_Dakota/Center"}, + {"usndnsl", "America/North_Dakota/New_Salem"}, + {"usnyc", "America/New_York"}, + {"usoea", "America/Indiana/Vincennes"}, + {"usome", "America/Nome"}, + {"usphx", "America/Phoenix"}, + {"ussit", "America/Sitka"}, + {"ustel", "America/Indiana/Tell_City"}, + {"uswlz", "America/Indiana/Winamac"}, + {"uswsq", "America/Indiana/Petersburg"}, + {"usxul", "America/North_Dakota/Beulah"}, + {"usyak", "America/Yakutat"}, + {"utc", "Etc/GMT"}, + {"utce01", "Etc/GMT-1"}, + {"utce02", "Etc/GMT-2"}, + {"utce03", "Etc/GMT-3"}, + {"utce04", "Etc/GMT-4"}, + {"utce05", "Etc/GMT-5"}, + {"utce06", "Etc/GMT-6"}, + {"utce07", "Etc/GMT-7"}, + {"utce08", "Etc/GMT-8"}, + {"utce09", "Etc/GMT-9"}, + {"utce10", "Etc/GMT-10"}, + {"utce11", "Etc/GMT-11"}, + {"utce12", "Etc/GMT-12"}, + {"utce13", "Etc/GMT-13"}, + {"utce14", "Etc/GMT-14"}, + {"utcw01", "Etc/GMT+1"}, + {"utcw02", "Etc/GMT+2"}, + {"utcw03", "Etc/GMT+3"}, + {"utcw04", "Etc/GMT+4"}, + {"utcw05", "Etc/GMT+5"}, + {"utcw06", "Etc/GMT+6"}, + {"utcw07", "Etc/GMT+7"}, + {"utcw08", "Etc/GMT+8"}, + {"utcw09", "Etc/GMT+9"}, + {"utcw10", "Etc/GMT+10"}, + {"utcw11", "Etc/GMT+11"}, + {"utcw12", "Etc/GMT+12"}, + {"uymvd", "America/Montevideo"}, + {"uzskd", "Asia/Samarkand"}, + {"uztas", "Asia/Tashkent"}, + {"vavat", "Europe/Vatican"}, + {"vcsvd", "America/St_Vincent"}, + {"veccs", "America/Caracas"}, + {"vgtov", "America/Tortola"}, + {"vistt", "America/St_Thomas"}, + {"vnsgn", "Asia/Saigon"}, + {"vuvli", "Pacific/Efate"}, + {"wfmau", "Pacific/Wallis"}, + {"wsapw", "Pacific/Apia"}, + {"yeade", "Asia/Aden"}, + {"ytmam", "Indian/Mayotte"}, + {"zajnb", "Africa/Johannesburg"}, + {"zmlun", "Africa/Lusaka"}, + {"zwhre", "Africa/Harare"}, + + }; + } + + @DataProvider(name="getLocalizedDateTimePattern") + Object[][] getLocalizedDateTimePattern() { + return new Object[][] { + // Locale, Expected pattern, + {Locale.US, FormatStyle.FULL, "EEEE, MMMM d, y 'at' h:mm:ss a zzzz"}, + {Locale.US, FormatStyle.LONG, "MMMM d, y 'at' h:mm:ss a z"}, + {Locale.US, FormatStyle.MEDIUM, "MMM d, y, h:mm:ss a"}, + {Locale.US, FormatStyle.SHORT, "M/d/yy, h:mm a"}, + {RG_GB, FormatStyle.FULL, "EEEE, d MMMM y 'at' HH:mm:ss zzzz"}, + {RG_GB, FormatStyle.LONG, "d MMMM y 'at' HH:mm:ss z"}, + {RG_GB, FormatStyle.MEDIUM, "d MMM y, HH:mm:ss"}, + {RG_GB, FormatStyle.SHORT, "dd/MM/y, HH:mm"}, + }; + } + + @DataProvider(name="getDisplayName") + Object[][] getDisplayName() { + return new Object[][] { + // Locale, field, Expected name, + {Locale.US, ChronoField.AMPM_OF_DAY, "AM/PM"}, + {RG_GB, ChronoField.AMPM_OF_DAY, "am/pm"}, + }; + } + + @Test(dataProvider="localizedBy") + public void test_localizedBy(Locale locale, Chronology chrono, ZoneId zone, + Chronology chronoExpected, ZoneId zoneExpected, + String formatExpected) { + DateTimeFormatter dtf = + DateTimeFormatter.ofLocalizedDateTime(FormatStyle.FULL, FormatStyle.FULL) + .withChronology(chrono).withZone(zone).localizedBy(locale); + assertEquals(dtf.getChronology(), chronoExpected); + assertEquals(dtf.getZone(), zoneExpected); + String formatted = dtf.format(ZDT); + assertEquals(formatted, formatExpected); + assertEquals(dtf.parse(formatted, ZonedDateTime::from), + zoneExpected != null ? ZDT.withZoneSameInstant(zoneExpected) : ZDT); + } + + @Test(dataProvider="withLocale") + public void test_withLocale(Locale locale, Chronology chrono, ZoneId zone, + Chronology chronoExpected, ZoneId zoneExpected, + String formatExpected) { + DateTimeFormatter dtf = + DateTimeFormatter.ofLocalizedDateTime(FormatStyle.FULL, FormatStyle.FULL) + .withChronology(chrono).withZone(zone).withLocale(locale); + assertEquals(dtf.getChronology(), chronoExpected); + assertEquals(dtf.getZone(), zoneExpected); + String formatted = dtf.format(ZDT); + assertEquals(formatted, formatExpected); + assertEquals(dtf.parse(formatted, ZonedDateTime::from), + zoneExpected != null ? ZDT.withZoneSameInstant(zoneExpected) : ZDT); + } + + @Test(dataProvider="firstDayOfWeek") + public void test_firstDayOfWeek(Locale locale, DayOfWeek dowExpected) { + DayOfWeek dow = WeekFields.of(locale).getFirstDayOfWeek(); + assertEquals(dow, dowExpected); + } + + @Test(dataProvider="minDaysInFirstWeek") + public void test_minDaysInFirstWeek(Locale locale, int minDaysExpected) { + int minDays = WeekFields.of(locale).getMinimalDaysInFirstWeek(); + assertEquals(minDays, minDaysExpected); + } + + @Test(dataProvider="ofPattern") + public void test_ofPattern(Locale locale, + Chronology chronoExpected, ZoneId zoneExpected, + String formatExpected) { + DateTimeFormatter dtf = + DateTimeFormatter.ofPattern(PATTERN, locale); + assertEquals(dtf.getChronology(), chronoExpected); + assertEquals(dtf.getZone(), zoneExpected); + String formatted = dtf.format(ZDT); + assertEquals(formatted, formatExpected); + assertEquals(dtf.parse(formatted, ZonedDateTime::from), + zoneExpected != null ? ZDT.withZoneSameInstant(zoneExpected) : ZDT); + } + + @Test(dataProvider="ofPattern") + public void test_toFormatter(Locale locale, + Chronology chronoExpected, ZoneId zoneExpected, + String formatExpected) { + DateTimeFormatter dtf = + new DateTimeFormatterBuilder().appendPattern(PATTERN).toFormatter(locale); + assertEquals(dtf.getChronology(), chronoExpected); + assertEquals(dtf.getZone(), zoneExpected); + String formatted = dtf.format(ZDT); + assertEquals(formatted, formatExpected); + assertEquals(dtf.parse(formatted, ZonedDateTime::from), + zoneExpected != null ? ZDT.withZoneSameInstant(zoneExpected) : ZDT); + } + + @Test(dataProvider="shortTZID") + public void test_shortTZID(String shortID, String expectedZone) { + Locale l = Locale.forLanguageTag("en-US-u-tz-" + shortID); + DateTimeFormatter dtf = + DateTimeFormatter.ofLocalizedDateTime(FormatStyle.FULL, FormatStyle.FULL) + .localizedBy(l); + assertEquals(dtf.getZone(), ZoneId.of(expectedZone)); + } + + @Test(dataProvider="getLocalizedDateTimePattern") + public void test_getLocalizedDateTimePattern(Locale l, FormatStyle s, String expectedPattern) { + DateTimeFormatterBuilder dtfb = new DateTimeFormatterBuilder(); + assertEquals(dtfb.getLocalizedDateTimePattern(s, s, IsoChronology.INSTANCE, l), + expectedPattern); + } + + @Test(dataProvider="getDisplayName") + public void test_getDisplayName(Locale l, TemporalField f, String expectedName) { + assertEquals(f.getDisplayName(l), expectedName); + } +} diff --git a/test/jdk/java/util/Calendar/Bug4302966.java b/test/jdk/java/util/Calendar/Bug4302966.java index 0dce8e2b367..03ed8c4eaac 100644 --- a/test/jdk/java/util/Calendar/Bug4302966.java +++ b/test/jdk/java/util/Calendar/Bug4302966.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 4302966 + * @bug 4302966 8176841 * @modules jdk.localedata * @summary In Czech Republic first day of week is Monday not Sunday */ @@ -34,7 +34,7 @@ import java.util.Locale; public class Bug4302966 { public static void main(String[] args) { - Calendar czechCalendar = Calendar.getInstance(new Locale("cs")); + Calendar czechCalendar = Calendar.getInstance(new Locale("cs", "CZ")); int firstDayOfWeek = czechCalendar.getFirstDayOfWeek(); if (firstDayOfWeek != Calendar.MONDAY) { throw new RuntimeException(); diff --git a/test/jdk/java/util/Calendar/CalendarDataTest.java b/test/jdk/java/util/Calendar/CalendarDataTest.java new file mode 100644 index 00000000000..fbd4b986a45 --- /dev/null +++ b/test/jdk/java/util/Calendar/CalendarDataTest.java @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8190918 + * @summary Tests for region dependent calendar data, i.e., + * firstDayOfWeek and minimalDaysInFirstWeek. + * @modules jdk.localedata + * @run main CalendarDataTest + */ + +import java.util.Calendar; +import java.util.List; +import java.util.Locale; +import java.util.Optional; +import java.util.stream.IntStream; + +public class CalendarDataTest { + + // golden data from CLDR + private static final List> FIRSTDAYDATA = List.of( + List.of("1", "AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT " + + "GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ " + + "NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE " + + "VI WS YE ZA ZW"), + List.of("2", "001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY " + + "CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP " + + "GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ " + + "MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ " + + "VA VN XK"), + List.of("6", "BD MV"), + List.of("7", "AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY")); + + private static final List> MINDAYSDATA = List.of( + List.of("1", "001 GU UM US VI"), + List.of("4", "AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR " + + "GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO " + + "PL PT RE SE SJ SK SM VA")); + + public static void main(String... args) throws Exception { + // world + Calendar cal = Calendar.getInstance(new Locale("", "001")); + checkResult("001", + cal.getFirstDayOfWeek(), + cal.getMinimalDaysInFirstWeek()); + + // two letter country codes + IntStream.range(0x41, 0x5b) + .forEach(c1 -> { + IntStream.range(0x41, 0x5b) + .mapToObj(c2 -> String.valueOf((char)c1) + String.valueOf((char)c2)) + .forEach(region -> { + Calendar c = Calendar.getInstance(new Locale("", region)); + checkResult(region, + c.getFirstDayOfWeek(), + c.getMinimalDaysInFirstWeek()); + }); + }); + } + + private static void checkResult(String region, int firstDay, int minDays) { + // first day of week + int expected = Integer.parseInt(findEntry(region, FIRSTDAYDATA) + .orElse(findEntry("001", FIRSTDAYDATA).orElse(List.of("1"))) + .get(0)); + if (firstDay != expected) { + throw new RuntimeException("firstDayOfWeek is incorrect for the region: " + + region + ". Returned: " + firstDay + ", Expected: " + expected); + } + + // minimal days in first week + expected = Integer.parseInt(findEntry(region, MINDAYSDATA) + .orElse(findEntry("001", MINDAYSDATA).orElse(List.of("1"))) + .get(0)); + if (minDays != expected) { + throw new RuntimeException("minimalDaysInFirstWeek is incorrect for the region: " + + region + ". Returned: " + firstDay + ", Expected: " + expected); + } + } + + private static Optional> findEntry(String region, List> data) { + return data.stream() + .filter(l -> l.get(1).contains(region)) + .findAny(); + } +} + diff --git a/test/jdk/java/util/Locale/bcp47u/CalendarTests.java b/test/jdk/java/util/Locale/bcp47u/CalendarTests.java new file mode 100644 index 00000000000..92cfc6581c5 --- /dev/null +++ b/test/jdk/java/util/Locale/bcp47u/CalendarTests.java @@ -0,0 +1,158 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * + * @test + * @bug 8176841 + * @summary Tests Calendar class deals with Unicode extensions + * correctly. + * @modules jdk.localedata + * @run testng/othervm CalendarTests + */ + +import static org.testng.Assert.assertEquals; + +import java.text.DateFormat; +import java.util.Calendar; +import java.util.Locale; +import java.util.TimeZone; + +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +/** + * Test Calendar with BCP47 U extensions + */ +@Test +public class CalendarTests { + private static TimeZone defaultTZ; + + private static final TimeZone ASIATOKYO = TimeZone.getTimeZone("Asia/Tokyo"); + private static final TimeZone AMLA = TimeZone.getTimeZone("America/Los_Angeles"); + + private static final Locale JPTYO = Locale.forLanguageTag("en-u-tz-jptyo"); + private static final Locale USLAX = Locale.forLanguageTag("en-u-tz-uslax"); + + private static final Locale FW_SUN = Locale.forLanguageTag("en-US-u-fw-sun"); + private static final Locale FW_MON = Locale.forLanguageTag("en-US-u-fw-mon"); + private static final Locale FW_TUE = Locale.forLanguageTag("en-US-u-fw-tue"); + private static final Locale FW_WED = Locale.forLanguageTag("en-US-u-fw-wed"); + private static final Locale FW_THU = Locale.forLanguageTag("en-US-u-fw-thu"); + private static final Locale FW_FRI = Locale.forLanguageTag("en-US-u-fw-fri"); + private static final Locale FW_SAT = Locale.forLanguageTag("en-US-u-fw-sat"); + + @BeforeTest + public void beforeTest() { + defaultTZ = TimeZone.getDefault(); + TimeZone.setDefault(AMLA); + } + + @AfterTest + public void afterTest() { + TimeZone.setDefault(defaultTZ); + } + + @DataProvider(name="tz") + Object[][] tz() { + return new Object[][] { + // Locale, Expected Zone, + {JPTYO, ASIATOKYO}, + {USLAX, AMLA}, + + // invalid + {Locale.forLanguageTag("en-US-u-tz-jpzzz"), AMLA} + }; + } + + @DataProvider(name="firstDayOfWeek") + Object[][] firstDayOfWeek () { + return new Object[][] { + // Locale, Expected DayOfWeek, + {Locale.US, Calendar.SUNDAY}, + {FW_SUN, Calendar.SUNDAY}, + {FW_MON, Calendar.MONDAY}, + {FW_TUE, Calendar.TUESDAY}, + {FW_WED, Calendar.WEDNESDAY}, + {FW_THU, Calendar.THURSDAY}, + {FW_FRI, Calendar.FRIDAY}, + {FW_SAT, Calendar.SATURDAY}, + + // invalid case + {Locale.forLanguageTag("en-US-u-fw-xxx"), Calendar.SUNDAY}, + + // region override + {Locale.forLanguageTag("en-US-u-rg-gbzzzz"), Calendar.MONDAY}, + {Locale.forLanguageTag("zh-CN-u-rg-eszzzz"), Calendar.MONDAY}, + + // "fw" and "rg". + {Locale.forLanguageTag("en-US-u-fw-wed-rg-gbzzzz"), Calendar.WEDNESDAY}, + {Locale.forLanguageTag("en-US-u-fw-xxx-rg-gbzzzz"), Calendar.MONDAY}, + {Locale.forLanguageTag("en-US-u-fw-xxx-rg-zzzz"), Calendar.SUNDAY}, + }; + } + + @DataProvider(name="minDaysInFirstWeek") + Object[][] minDaysInFrstWeek () { + return new Object[][] { + // Locale, Expected minDay, + {Locale.US, 1}, + + // region override + {Locale.forLanguageTag("en-US-u-rg-gbzzzz"), 4}, + {Locale.forLanguageTag("zh-CN-u-rg-eszzzz"), 4}, + }; + } + + @Test(dataProvider="tz") + public void test_tz(Locale locale, TimeZone zoneExpected) { + DateFormat df = DateFormat.getTimeInstance(DateFormat.FULL, locale); + assertEquals(df.getTimeZone(), zoneExpected); + + Calendar c = Calendar.getInstance(locale); + assertEquals(c.getTimeZone(), zoneExpected); + + c = new Calendar.Builder().setLocale(locale).build(); + assertEquals(c.getTimeZone(), zoneExpected); + } + + @Test(dataProvider="firstDayOfWeek") + public void test_firstDayOfWeek(Locale locale, int dowExpected) { + Calendar c = Calendar.getInstance(locale); + assertEquals(c.getFirstDayOfWeek(), dowExpected); + + c = new Calendar.Builder().setLocale(locale).build(); + assertEquals(c.getFirstDayOfWeek(), dowExpected); + } + + @Test(dataProvider="minDaysInFirstWeek") + public void test_minDaysInFirstWeek(Locale locale, int minDaysExpected) { + Calendar c = Calendar.getInstance(locale); + assertEquals(c.getMinimalDaysInFirstWeek(), minDaysExpected); + + c = new Calendar.Builder().setLocale(locale).build(); + assertEquals(c.getMinimalDaysInFirstWeek(), minDaysExpected); + } +} diff --git a/test/jdk/java/util/Locale/bcp47u/CurrencyTests.java b/test/jdk/java/util/Locale/bcp47u/CurrencyTests.java new file mode 100644 index 00000000000..d807a0e4da3 --- /dev/null +++ b/test/jdk/java/util/Locale/bcp47u/CurrencyTests.java @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * + * @test + * @bug 8176841 + * @summary Tests Currency class instantiates correctly with Unicode + * extensions + * @modules jdk.localedata + * @run testng/othervm CurrencyTests + */ + +import static org.testng.Assert.assertEquals; + +import java.util.Currency; +import java.util.Locale; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +/** + * Test Currency with BCP47 U extensions + */ +@Test +public class CurrencyTests { + private static final Currency USD = Currency.getInstance("USD"); + private static final Currency CAD = Currency.getInstance("CAD"); + private static final Currency JPY = Currency.getInstance("JPY"); + + @DataProvider(name="getInstanceData") + Object[][] getInstanceData() { + return new Object[][] { + // Locale, Expected Currency + // "cu" + {Locale.forLanguageTag("en-US-u-cu-jpy"), JPY}, + {Locale.forLanguageTag("ja-JP-u-cu-usd"), USD}, + {Locale.forLanguageTag("en-US-u-cu-foobar"), USD}, + {Locale.forLanguageTag("en-US-u-cu-zzz"), USD}, + + // "rg" + {Locale.forLanguageTag("en-US-u-rg-jpzzzz"), JPY}, + {Locale.forLanguageTag("ja-JP-u-rg-uszzzz"), USD}, + {Locale.forLanguageTag("ja-JP-u-rg-001zzzz"), JPY}, + {Locale.forLanguageTag("en-US-u-rg-jpz"), USD}, + + // "cu" and "rg". "cu" should win + {Locale.forLanguageTag("en-CA-u-cu-jpy-rg-uszzzz"), JPY}, + + // invaid "cu" and valid "rg". "rg" should win + {Locale.forLanguageTag("en-CA-u-cu-jpyy-rg-uszzzz"), USD}, + {Locale.forLanguageTag("en-CA-u-cu-zzz-rg-uszzzz"), USD}, + + // invaid "cu" and invalid "rg". both should be ignored + {Locale.forLanguageTag("en-CA-u-cu-jpyy-rg-jpzz"), CAD}, + }; + } + + @DataProvider(name="getSymbolData") + Object[][] getSymbolData() { + return new Object[][] { + // Currency, DisplayLocale, expected Symbol + {USD, Locale.forLanguageTag("en-US-u-rg-jpzzzz"), "$"}, + {USD, Locale.forLanguageTag("en-US-u-rg-cazzzz"), "US$"}, + {USD, Locale.forLanguageTag("en-CA-u-rg-uszzzz"), "$"}, + + {CAD, Locale.forLanguageTag("en-US-u-rg-jpzzzz"), "CA$"}, + {CAD, Locale.forLanguageTag("en-US-u-rg-cazzzz"), "$"}, + {CAD, Locale.forLanguageTag("en-CA-u-rg-uszzzz"), "CA$"}, + + {JPY, Locale.forLanguageTag("ja-JP-u-rg-uszzzz"), "\uffe5"}, + {JPY, Locale.forLanguageTag("en-US-u-rg-jpzzzz"), "\u00a5"}, + {JPY, Locale.forLanguageTag("ko-KR-u-rg-jpzzzz"), "JP\u00a5"}, + }; + } + + @Test(dataProvider="getInstanceData") + public void test_getInstance(Locale locale, Currency currencyExpected) { + assertEquals(Currency.getInstance(locale), currencyExpected); + } + + @Test(dataProvider="getSymbolData") + public void test_getSymbol(Currency c, Locale locale, String expected) { + assertEquals(c.getSymbol(locale), expected); + } +} diff --git a/test/jdk/java/util/Locale/bcp47u/DefaultLocaleTest.java b/test/jdk/java/util/Locale/bcp47u/DefaultLocaleTest.java new file mode 100644 index 00000000000..9e07a64e767 --- /dev/null +++ b/test/jdk/java/util/Locale/bcp47u/DefaultLocaleTest.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.util.Locale; + +/* + * Test application that verifies default locales. Invoked from + * SystemPropertyTests + */ +public class DefaultLocaleTest { + public static void main(String... args) { + String defLoc = Locale.getDefault().toString(); + String defFmtLoc = Locale.getDefault(Locale.Category.FORMAT).toString(); + String defDspLoc = Locale.getDefault(Locale.Category.DISPLAY).toString(); + + if (!defLoc.equals(args[0]) || + !defFmtLoc.equals(args[1]) || + !defDspLoc.equals(args[2])) { + System.err.println("Some default locale(s) don't match.\n" + + "Default Locale expected: " + args[0] + ", result: " + defLoc + "\n" + + "Default Format Locale expected: " + args[1] + ", result: " + defFmtLoc + "\n" + + "Default Display Locale expected: " + args[2] + ", result: " + defDspLoc); + System.exit(-1); + } + } +} diff --git a/test/jdk/java/util/Locale/bcp47u/DisplayNameTests.java b/test/jdk/java/util/Locale/bcp47u/DisplayNameTests.java new file mode 100644 index 00000000000..a6b7776ec43 --- /dev/null +++ b/test/jdk/java/util/Locale/bcp47u/DisplayNameTests.java @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * + * @test + * @bug 8176841 + * @summary Tests the display names for BCP 47 U extensions + * @modules jdk.localedata + * @run testng/othervm -Djava.locale.providers=CLDR DisplayNameTests + */ + +import static org.testng.Assert.assertEquals; + +import java.util.Locale; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +/** + * Test Locale.getDisplayName() with BCP47 U extensions. Note that the + * result may change depending on the CLDR releases. + */ +@Test +public class DisplayNameTests { + private static final Locale loc1 = Locale.forLanguageTag("en-Latn-US-u" + + "-ca-japanese" + + "-cf-account" + + "-co-pinyin" + + "-cu-jpy" + + "-em-emoji" + + "-fw-wed" + + "-hc-h23" + + "-lb-loose" + + "-lw-breakall" + + "-ms-uksystem" + + "-nu-roman" + + "-rg-gbzzzz" + + "-sd-gbsct" + + "-ss-standard" + + "-tz-jptyo" + + "-va-posix"); + private static final Locale loc2 = new Locale("ja", "JP", "JP"); + private static final Locale loc3 = new Locale.Builder() + .setRegion("US") + .setScript("Latn") + .setUnicodeLocaleKeyword("ca", "japanese") + .build(); + private static final Locale loc4 = new Locale.Builder() + .setRegion("US") + .setUnicodeLocaleKeyword("ca", "japanese") + .build(); + private static final Locale loc5 = new Locale.Builder() + .setUnicodeLocaleKeyword("ca", "japanese") + .build(); + private static final Locale loc6 = Locale.forLanguageTag( "zh-CN-u-ca-dddd-nu-ddd-cu-ddd-fw-moq-tz-unknown-rg-twzz"); + + @DataProvider(name="locales") + Object[][] tz() { + return new Object[][] { + // Locale for display, Test Locale, Expected output, + {Locale.US, loc1, + "English (Latin, United States, Japanese Calendar, Accounting Currency Format, Pinyin Sort Order, Currency: Japanese Yen, Prefer Emoji Presentation For Emoji Characters, First Day of Week Is Wednesday, 24 Hour System (0\u201323), Loose Line Break Style, Allow Line Breaks In All Words, Imperial Measurement System, Roman Numerals, Region For Supplemental Data: United Kingdom, Region Subdivision: gbsct, Suppress Sentence Breaks After Standard Abbreviations, Time Zone: Japan Time, POSIX Compliant Locale)"}, + {Locale.JAPAN, loc1, + "\u82f1\u8a9e (\u30e9\u30c6\u30f3\u6587\u5b57\u3001\u30a2\u30e1\u30ea\u30ab\u5408\u8846\u56fd\u3001\u548c\u66a6\u3001cf: account\u3001\u30d4\u30f3\u30a4\u30f3\u9806\u3001\u901a\u8ca8: \u65e5\u672c\u5186\u3001em: emoji\u3001fw: wed\u300124\u6642\u9593\u5236(0\u301c23)\u3001\u7981\u5247\u51e6\u7406(\u5f31)\u3001lw: breakall\u3001\u30e4\u30fc\u30c9\u30fb\u30dd\u30f3\u30c9\u6cd5\u3001\u30ed\u30fc\u30de\u6570\u5b57\u3001rg: \u30a4\u30ae\u30ea\u30b9\u3001sd: gbsct\u3001ss: standard\u3001\u30bf\u30a4\u30e0\u30be\u30fc\u30f3: \u65e5\u672c\u6642\u9593\u3001\u30ed\u30b1\u30fc\u30eb\u306e\u30d0\u30ea\u30a2\u30f3\u30c8: posix)"}, + {Locale.forLanguageTag("hi-IN"), loc1, + "\u0905\u0902\u0917\u094d\u0930\u0947\u091c\u093c\u0940 (\u0932\u0948\u091f\u093f\u0928, \u0938\u0902\u092f\u0941\u0915\u094d\u0924 \u0930\u093e\u091c\u094d\u092f, \u091c\u093e\u092a\u093e\u0928\u0940 \u092a\u0902\u091a\u093e\u0902\u0917, cf: account, \u092a\u093f\u0928\u092f\u0940\u0928 \u0935\u0930\u094d\u0917\u0940\u0915\u0930\u0923, \u092e\u0941\u0926\u094d\u0930\u093e: \u091c\u093e\u092a\u093e\u0928\u0940 \u092f\u0947\u0928, em: emoji, fw: wed, 24 \u0918\u0902\u091f\u094b\u0902 \u0915\u0940 \u092a\u094d\u0930\u0923\u093e\u0932\u0940 (0\u201323), \u0922\u0940\u0932\u0940 \u092a\u0902\u0915\u094d\u0924\u093f \u0935\u093f\u091a\u094d\u091b\u0947\u0926 \u0936\u0948\u0932\u0940, lw: breakall, \u0907\u092e\u094d\u092a\u0940\u0930\u093f\u092f\u0932 \u092e\u093e\u092a\u0928 \u092a\u094d\u0930\u0923\u093e\u0932\u0940, \u0930\u094b\u092e\u0928 \u0938\u0902\u0916\u094d\u092f\u093e\u090f\u0901, rg: \u092f\u0942\u0928\u093e\u0907\u091f\u0947\u0921 \u0915\u093f\u0902\u0917\u0921\u092e, sd: gbsct, ss: standard, \u0938\u092e\u092f \u0915\u094d\u0937\u0947\u0924\u094d\u0930: \u091c\u093e\u092a\u093e\u0928 \u0938\u092e\u092f, \u0938\u094d\u0925\u093e\u0928\u0940\u092f \u092a\u094d\u0930\u0915\u093e\u0930: posix)"}, + + // cases where no localized types are available. fall back to "key: type" + {Locale.US, Locale.forLanguageTag("en-u-ca-unknown"), "English (Calendar: unknown)"}, + + // cases with variant, w/o language, script + {Locale.US, loc2, "Japanese (Japan, JP, Japanese Calendar)"}, + {Locale.US, loc3, "Latin (United States, Japanese Calendar)"}, + {Locale.US, loc4, "United States (Japanese Calendar)"}, + {Locale.US, loc5, ""}, + + // invalid cases + {loc6, loc6, "\u4e2d\u6587 (\u4e2d\u56fd\u3001\u65e5\u5386\uff1adddd\u3001\u8d27\u5e01\uff1addd\u3001fw\uff1amoq\u3001\u6570\u5b57\uff1addd\u3001rg\uff1atwzz\u3001\u65f6\u533a\uff1aunknown)"}, + {Locale.US, loc6, "Chinese (China, Calendar: dddd, Currency: ddd, First day of week: moq, Numbers: ddd, Region For Supplemental Data: twzz, Time Zone: unknown)"}, + }; + } + + @Test(dataProvider="locales") + public void test_locales(Locale inLocale, Locale testLocale, String expected) { + String result = testLocale.getDisplayName(inLocale); + assertEquals(result, expected); + } +} diff --git a/test/jdk/java/util/Locale/bcp47u/FormatTests.java b/test/jdk/java/util/Locale/bcp47u/FormatTests.java new file mode 100644 index 00000000000..6c64a00c8a6 --- /dev/null +++ b/test/jdk/java/util/Locale/bcp47u/FormatTests.java @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * + * @test + * @bug 8176841 + * @summary Tests *Format class deals with Unicode extensions + * correctly. + * @modules jdk.localedata + * @run testng/othervm -Djava.locale.providers=CLDR FormatTests + */ + +import static org.testng.Assert.assertEquals; + +import java.text.DateFormat; +import java.text.NumberFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.Locale; +import java.util.TimeZone; + +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +/** + * Test *Format classes with BCP47 U extensions + */ +@Test +public class FormatTests { + private static TimeZone defaultTZ; + + private static final TimeZone ASIATOKYO = TimeZone.getTimeZone("Asia/Tokyo"); + private static final TimeZone AMLA = TimeZone.getTimeZone("America/Los_Angeles"); + + private static final Locale JPTYO = Locale.forLanguageTag("en-u-tz-jptyo"); + private static final Locale JCAL = Locale.forLanguageTag("en-u-ca-japanese"); + private static final Locale USLAX = Locale.forLanguageTag("en-u-tz-uslax"); + + private static final Locale RG_GB = Locale.forLanguageTag("en-US-u-rg-gbzzzz"); + private static final Locale RG_DE = Locale.forLanguageTag("en-US-u-rg-dezzzz"); + + private static final Locale NU_DEVA = Locale.forLanguageTag("en-US-u-nu-deva"); + private static final Locale NU_SINH = Locale.forLanguageTag("en-US-u-nu-sinh"); + private static final Locale NU_ZZZZ = Locale.forLanguageTag("en-US-u-nu-zzzz"); + + private static final double testNum = 12345.6789; + private static final String NUM_US = "12,345.6789"; + private static final String NUM_DE = "12.345,6789"; + private static final String NUM_DEVA = "\u0967\u0968,\u0969\u096a\u096b.\u096c\u096d\u096e\u096f"; + private static final String NUM_SINH = "\u0de7\u0de8,\u0de9\u0dea\u0deb.\u0dec\u0ded\u0dee\u0def"; + + private static final Date testDate = new Calendar.Builder() + .setDate(2017, 7, 10) + .setTimeOfDay(15, 15, 0) + .setTimeZone(AMLA) + .build() + .getTime(); + + @BeforeTest + public void beforeTest() { + defaultTZ = TimeZone.getDefault(); + TimeZone.setDefault(AMLA); + } + + @AfterTest + public void afterTest() { + TimeZone.setDefault(defaultTZ); + } + + @DataProvider(name="dateFormatData") + Object[][] dateFormatData() { + return new Object[][] { + // Locale, Expected calendar, Expected timezone, Expected formatted string + + // -ca + {JCAL, "java.util.JapaneseImperialCalendar", null, + "Thursday, August 10, 29 Heisei at 3:15:00 PM Pacific Daylight Time" + }, + + // -tz + {JPTYO, null, ASIATOKYO, + "Friday, August 11, 2017 at 7:15:00 AM Japan Standard Time" + }, + {USLAX, null, AMLA, + "Thursday, August 10, 2017 at 3:15:00 PM Pacific Daylight Time" + }, + + // -rg + {RG_GB, null, null, + "Thursday, 10 August 2017 at 15:15:00 Pacific Daylight Time" + }, + }; + } + + @DataProvider(name="numberFormatData") + Object[][] numberFormatData() { + return new Object[][] { + // Locale, number, expected format + + // -nu + {NU_DEVA, testNum, NUM_DEVA}, + {NU_SINH, testNum, NUM_SINH}, + {NU_ZZZZ, testNum, NUM_US}, + + // -rg + {RG_DE, testNum, NUM_DE}, + + // -nu & -rg, valid & invalid + {Locale.forLanguageTag("en-US-u-nu-deva-rg-dezzzz"), testNum, NUM_DEVA}, + {Locale.forLanguageTag("en-US-u-nu-zzzz-rg-dezzzz"), testNum, NUM_US}, + {Locale.forLanguageTag("en-US-u-nu-zzzz-rg-zzzz"), testNum, NUM_US}, + }; + } + + @Test(dataProvider="dateFormatData") + public void test_DateFormat(Locale locale, String calClass, TimeZone tz, + String formatExpected) throws Exception { + DateFormat df = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL, locale); + if (calClass != null) { + try { + Class expected = Class.forName(calClass); + assertEquals(df.getCalendar().getClass(), expected); + } catch (Exception e) { + throw e; + } + } + if (tz != null) { + assertEquals(df.getTimeZone(), tz); + } + String formatted = df.format(testDate); + assertEquals(formatted, formatExpected); + assertEquals(df.parse(formatted), testDate); + } + + @Test(dataProvider="numberFormatData") + public void test_NumberFormat(Locale locale, double num, + String formatExpected) throws Exception { + NumberFormat nf = NumberFormat.getNumberInstance(locale); + nf.setMaximumFractionDigits(4); + String formatted = nf.format(num); + assertEquals(nf.format(num), formatExpected); + assertEquals(nf.parse(formatted), num); + } +} diff --git a/test/jdk/java/util/Locale/bcp47u/SymbolsTests.java b/test/jdk/java/util/Locale/bcp47u/SymbolsTests.java new file mode 100644 index 00000000000..d8824ed4811 --- /dev/null +++ b/test/jdk/java/util/Locale/bcp47u/SymbolsTests.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * + * @test + * @bug 8176841 + * @summary Tests *FormatSymbols class deals with Unicode extensions + * correctly. + * @modules jdk.localedata + * @run testng/othervm -Djava.locale.providers=CLDR FormatTests + */ + +import static org.testng.Assert.assertEquals; + +import java.text.DateFormatSymbols; +import java.text.DecimalFormatSymbols; +import java.util.Locale; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +/** + * Test *FormatSymbols classes with BCP47 U extensions + */ +@Test +public class SymbolsTests { + + private static final Locale RG_GB = Locale.forLanguageTag("en-US-u-rg-gbzzzz"); + private static final Locale RG_IE = Locale.forLanguageTag("en-US-u-rg-iezzzz"); + private static final Locale RG_AT = Locale.forLanguageTag("en-US-u-rg-atzzzz"); + + @DataProvider(name="dateFormatSymbolsData") + Object[][] dateFormatSymbolsData() { + return new Object[][] { + // Locale, expected AM string, expected PM string + + {RG_GB, "am", "pm"}, + {RG_IE, "a.m.", "p.m."}, + {Locale.US, "AM", "PM"}, + }; + } + + @DataProvider(name="decimalFormatSymbolsData") + Object[][] decimalFormatSymbolsData() { + return new Object[][] { + // Locale, expected decimal separator, expected grouping separator + + {RG_AT, ",", "."}, + {Locale.US, ".", ","}, + + // -nu & -rg mixed. -nu should win + {Locale.forLanguageTag("ar-EG-u-nu-latn-rg-mazzzz"), ".", ","}, + }; + } + + @Test(dataProvider="dateFormatSymbolsData") + public void test_DateFormatSymbols(Locale locale, String amExpected, String pmExpected) { + DateFormatSymbols dfs = DateFormatSymbols.getInstance(locale); + String[] ampm = dfs.getAmPmStrings(); + assertEquals(ampm[0], amExpected); + assertEquals(ampm[1], pmExpected); + } + + @Test(dataProvider="decimalFormatSymbolsData") + public void test_DecimalFormatSymbols(Locale locale, char decimal, char grouping) { + DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance(locale); + assertEquals(dfs.getDecimalSeparator(), decimal); + assertEquals(dfs.getGroupingSeparator(), grouping); + } +} diff --git a/test/jdk/java/util/Locale/bcp47u/SystemPropertyTests.java b/test/jdk/java/util/Locale/bcp47u/SystemPropertyTests.java new file mode 100644 index 00000000000..e7cecf3bfd5 --- /dev/null +++ b/test/jdk/java/util/Locale/bcp47u/SystemPropertyTests.java @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /lib/testlibrary + * @bug 8189134 + * @summary Tests the system properties + * @modules jdk.localedata + * @build DefaultLocaleTest jdk.testlibrary.* + * @run testng/othervm SystemPropertyTests + */ + +import static jdk.testlibrary.ProcessTools.executeTestJava; +import static org.testng.Assert.assertTrue; + +import java.util.Locale; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +/** + * Test Locale.getDefault() reflects the system property. Note that the + * result may change depending on the CLDR releases. + */ +@Test +public class SystemPropertyTests { + + private static String LANGPROP = "-Duser.language=en"; + private static String CTRYPROP = "-Duser.country=US"; + + @DataProvider(name="data") + Object[][] data() { + return new Object[][] { + // system property, expected default, expected format, expected display + {"-Duser.extensions=u-ca-japanese", + "en_US_#u-ca-japanese", + "en_US_#u-ca-japanese", + "en_US_#u-ca-japanese", + }, + + {"-Duser.extensions=u-ca-japanese-nu-thai", + "en_US_#u-ca-japanese-nu-thai", + "en_US_#u-ca-japanese-nu-thai", + "en_US_#u-ca-japanese-nu-thai", + }, + + {"-Duser.extensions=foo", + "en_US", + "en_US", + "en_US", + }, + + {"-Duser.extensions.format=u-ca-japanese", + "en_US", + "en_US_#u-ca-japanese", + "en_US", + }, + + {"-Duser.extensions.display=u-ca-japanese", + "en_US", + "en_US", + "en_US_#u-ca-japanese", + }, + }; + } + + @Test(dataProvider="data") + public void runTest(String extprop, String defLoc, + String defFmtLoc, String defDspLoc) throws Exception { + int exitValue = executeTestJava(LANGPROP, CTRYPROP, + extprop, "DefaultLocaleTest", defLoc, defFmtLoc, defDspLoc) + .outputTo(System.out) + .errorTo(System.out) + .getExitValue(); + + assertTrue(exitValue == 0); + } +} diff --git a/test/jdk/java/util/Locale/bcp47u/spi/LocaleNameProviderTests.java b/test/jdk/java/util/Locale/bcp47u/spi/LocaleNameProviderTests.java new file mode 100644 index 00000000000..98933dac253 --- /dev/null +++ b/test/jdk/java/util/Locale/bcp47u/spi/LocaleNameProviderTests.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * + * @test + * @bug 8176841 + * @summary Tests LocaleNameProvider SPIs + * @library provider + * @build provider/module-info provider/foo.LocaleNameProviderImpl + * @run main/othervm -Djava.locale.providers=SPI LocaleNameProviderTests + */ + +import java.util.Locale; + +/** + * Test LocaleNameProvider SPI with BCP47 U extensions + * + * Verifies getUnicodeExtensionKey() and getUnicodeExtensionType() methods in + * LocaleNameProvider works. + */ +public class LocaleNameProviderTests { + private static final String expected = "foo (foo_ca:foo_japanese)"; + + public static void main(String... args) { + String name = Locale.forLanguageTag("foo-u-ca-japanese").getDisplayName(new Locale("foo")); + if (!name.equals(expected)) { + throw new RuntimeException("Unicode extension key and/or type name(s) is incorrect. " + + "Expected: \"" + expected + "\", got: \"" + name + "\""); + } + } +} diff --git a/test/jdk/java/util/Locale/bcp47u/spi/provider/foo/LocaleNameProviderImpl.java b/test/jdk/java/util/Locale/bcp47u/spi/provider/foo/LocaleNameProviderImpl.java new file mode 100644 index 00000000000..ce63fec7742 --- /dev/null +++ b/test/jdk/java/util/Locale/bcp47u/spi/provider/foo/LocaleNameProviderImpl.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package foo; + +import java.util.Locale; +import java.util.spi.LocaleNameProvider; + +/* + * Implements LocaleNameProvider SPI, augmenting the default + * values for Unicode Locale Extension key/type names. + */ +public class LocaleNameProviderImpl extends LocaleNameProvider { + private static final Locale[] avail = {new Locale("foo")}; + + @Override + public Locale[] getAvailableLocales() { + return avail; + } + + @Override + public String getDisplayLanguage(String lang, Locale target) { + return null; + } + + @Override + public String getDisplayCountry(String ctry, Locale target) { + return null; + } + + @Override + public String getDisplayVariant(String vrnt, Locale target) { + return null; + } + + @Override + public String getDisplayUnicodeExtensionKey(String key, Locale target) { + return "foo_" + key; + } + + @Override + public String getDisplayUnicodeExtensionType(String extType, String key, Locale target) { + return "foo_" + key + ":foo_" + extType; + } +} diff --git a/test/jdk/java/util/Locale/bcp47u/spi/provider/module-info.java b/test/jdk/java/util/Locale/bcp47u/spi/provider/module-info.java new file mode 100644 index 00000000000..0010072614a --- /dev/null +++ b/test/jdk/java/util/Locale/bcp47u/spi/provider/module-info.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +module provider { + exports foo; + provides java.util.spi.LocaleNameProvider with foo.LocaleNameProviderImpl; +} diff --git a/test/jdk/sun/text/resources/LocaleData.cldr b/test/jdk/sun/text/resources/LocaleData.cldr index ad4bcadd020..2d368167a23 100644 --- a/test/jdk/sun/text/resources/LocaleData.cldr +++ b/test/jdk/sun/text/resources/LocaleData.cldr @@ -34,8 +34,8 @@ FormatData/pt_BR/DayAbbreviations/2=ter FormatData/pt_BR/DayNames/0=domingo FormatData/pt_BR/DayNames/1=segunda-feira FormatData/pt_BR/DayNames/2=ter\u00e7a-feira -CalendarData/pt_BR/firstDayOfWeek=1 -CalendarData/pt_BR/minimalDaysInFirstWeek=1 +CalendarData/pt_BR/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/pt_BR/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA FormatData/pt_BR/MonthNames/0=janeiro FormatData/pt_BR/MonthNames/1=fevereiro FormatData/pt_BR/MonthNames/2=mar\u00e7o @@ -189,8 +189,8 @@ FormatData/pl_PL/MonthAbbreviations/9=pa\u017a FormatData/pl_PL/MonthAbbreviations/10=lis FormatData/pl_PL/MonthAbbreviations/11=gru FormatData/pl_PL/MonthAbbreviations/12= -CalendarData/pl_PL/firstDayOfWeek=2 -CalendarData/pl_PL/minimalDaysInFirstWeek=4 +CalendarData/pl_PL/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/pl_PL/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA FormatData/pl_PL/AmPmMarkers/0=AM FormatData/pl_PL/AmPmMarkers/1=PM @@ -320,8 +320,8 @@ FormatData/ru_RU/DayAbbreviations/5=\u043f\u0442 FormatData/ru_RU/DayAbbreviations/6=\u0441\u0431 FormatData/ru_RU/AmPmMarkers/0=\u0414\u041f FormatData/ru_RU/AmPmMarkers/1=\u041f\u041f -CalendarData/ru_RU/firstDayOfWeek=2 -CalendarData/ru_RU/minimalDaysInFirstWeek=1 +CalendarData/ru_RU/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/ru_RU/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA # bug #4094371, 4098518, 4290801, 6558863 FormatData/en_AU/TimePatterns/0=h:mm:ss a zzzz @@ -745,8 +745,8 @@ FormatData/ar_AE/DayNames/3=\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621 FormatData/ar_AE/DayNames/4=\u0627\u0644\u062e\u0645\u064a\u0633 FormatData/ar_AE/DayNames/5=\u0627\u0644\u062c\u0645\u0639\u0629 FormatData/ar_AE/DayNames/6=\u0627\u0644\u0633\u0628\u062a -CalendarData/ar_AE/firstDayOfWeek=7 -CalendarData/ar_AE/minimalDaysInFirstWeek=1 +CalendarData/ar_AE/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/ar_AE/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA FormatData/ar_AE/MonthAbbreviations/0=\u064a\u0646\u0627\u064a\u0631 FormatData/ar_AE/MonthAbbreviations/1=\u0641\u0628\u0631\u0627\u064a\u0631 FormatData/ar_AE/MonthAbbreviations/2=\u0645\u0627\u0631\u0633 @@ -833,8 +833,8 @@ FormatData/ar_BH/DayNames/3=\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621 FormatData/ar_BH/DayNames/4=\u0627\u0644\u062e\u0645\u064a\u0633 FormatData/ar_BH/DayNames/5=\u0627\u0644\u062c\u0645\u0639\u0629 FormatData/ar_BH/DayNames/6=\u0627\u0644\u0633\u0628\u062a -CalendarData/ar_BH/firstDayOfWeek=7 -CalendarData/ar_BH/minimalDaysInFirstWeek=1 +CalendarData/ar_BH/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/ar_BH/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA FormatData/ar_BH/MonthAbbreviations/0=\u064a\u0646\u0627\u064a\u0631 FormatData/ar_BH/MonthAbbreviations/1=\u0641\u0628\u0631\u0627\u064a\u0631 FormatData/ar_BH/MonthAbbreviations/2=\u0645\u0627\u0631\u0633 @@ -921,8 +921,8 @@ FormatData/ar_DZ/DayNames/3=\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621 FormatData/ar_DZ/DayNames/4=\u0627\u0644\u062e\u0645\u064a\u0633 FormatData/ar_DZ/DayNames/5=\u0627\u0644\u062c\u0645\u0639\u0629 FormatData/ar_DZ/DayNames/6=\u0627\u0644\u0633\u0628\u062a -CalendarData/ar_DZ/firstDayOfWeek=7 -CalendarData/ar_DZ/minimalDaysInFirstWeek=1 +CalendarData/ar_DZ/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/ar_DZ/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA FormatData/ar_DZ/MonthAbbreviations/0=\u062c\u0627\u0646\u0641\u064a FormatData/ar_DZ/MonthAbbreviations/1=\u0641\u064a\u0641\u0631\u064a FormatData/ar_DZ/MonthAbbreviations/2=\u0645\u0627\u0631\u0633 @@ -1009,8 +1009,8 @@ FormatData/ar_EG/DayNames/3=\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621 FormatData/ar_EG/DayNames/4=\u0627\u0644\u062e\u0645\u064a\u0633 FormatData/ar_EG/DayNames/5=\u0627\u0644\u062c\u0645\u0639\u0629 FormatData/ar_EG/DayNames/6=\u0627\u0644\u0633\u0628\u062a -CalendarData/ar_EG/firstDayOfWeek=7 -CalendarData/ar_EG/minimalDaysInFirstWeek=1 +CalendarData/ar_EG/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/ar_EG/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA FormatData/ar_EG/MonthAbbreviations/0=\u064a\u0646\u0627\u064a\u0631 FormatData/ar_EG/MonthAbbreviations/1=\u0641\u0628\u0631\u0627\u064a\u0631 FormatData/ar_EG/MonthAbbreviations/2=\u0645\u0627\u0631\u0633 @@ -1097,8 +1097,8 @@ FormatData/ar_IQ/DayNames/3=\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621 FormatData/ar_IQ/DayNames/4=\u0627\u0644\u062e\u0645\u064a\u0633 FormatData/ar_IQ/DayNames/5=\u0627\u0644\u062c\u0645\u0639\u0629 FormatData/ar_IQ/DayNames/6=\u0627\u0644\u0633\u0628\u062a -CalendarData/ar_IQ/firstDayOfWeek=7 -CalendarData/ar_IQ/minimalDaysInFirstWeek=1 +CalendarData/ar_IQ/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/ar_IQ/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA FormatData/ar_IQ/MonthAbbreviations/0=\u0643\u0627\u0646\u0648\u0646 \u0627\u0644\u062b\u0627\u0646\u064a FormatData/ar_IQ/MonthAbbreviations/1=\u0634\u0628\u0627\u0637 FormatData/ar_IQ/MonthAbbreviations/2=\u0622\u0630\u0627\u0631 @@ -1218,8 +1218,8 @@ FormatData/ar_JO/DayNames/3=\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621 FormatData/ar_JO/DayNames/4=\u0627\u0644\u062e\u0645\u064a\u0633 FormatData/ar_JO/DayNames/5=\u0627\u0644\u062c\u0645\u0639\u0629 FormatData/ar_JO/DayNames/6=\u0627\u0644\u0633\u0628\u062a -CalendarData/ar_JO/firstDayOfWeek=7 -CalendarData/ar_JO/minimalDaysInFirstWeek=1 +CalendarData/ar_JO/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/ar_JO/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA FormatData/ar_JO/Eras/0=\u0642.\u0645 FormatData/ar_JO/Eras/1=\u0645 LocaleNames/ar_JO/ar=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 @@ -1273,8 +1273,8 @@ FormatData/ar_KW/DayNames/3=\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621 FormatData/ar_KW/DayNames/4=\u0627\u0644\u062e\u0645\u064a\u0633 FormatData/ar_KW/DayNames/5=\u0627\u0644\u062c\u0645\u0639\u0629 FormatData/ar_KW/DayNames/6=\u0627\u0644\u0633\u0628\u062a -CalendarData/ar_KW/firstDayOfWeek=7 -CalendarData/ar_KW/minimalDaysInFirstWeek=1 +CalendarData/ar_KW/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/ar_KW/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA FormatData/ar_KW/MonthAbbreviations/0=\u064a\u0646\u0627\u064a\u0631 FormatData/ar_KW/MonthAbbreviations/1=\u0641\u0628\u0631\u0627\u064a\u0631 FormatData/ar_KW/MonthAbbreviations/2=\u0645\u0627\u0631\u0633 @@ -1394,8 +1394,8 @@ FormatData/ar_LB/DayNames/3=\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621 FormatData/ar_LB/DayNames/4=\u0627\u0644\u062e\u0645\u064a\u0633 FormatData/ar_LB/DayNames/5=\u0627\u0644\u062c\u0645\u0639\u0629 FormatData/ar_LB/DayNames/6=\u0627\u0644\u0633\u0628\u062a -CalendarData/ar_LB/firstDayOfWeek=2 -CalendarData/ar_LB/minimalDaysInFirstWeek=1 +CalendarData/ar_LB/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/ar_LB/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA FormatData/ar_LB/Eras/0=\u0642.\u0645 FormatData/ar_LB/Eras/1=\u0645 LocaleNames/ar_LB/ar=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 @@ -1449,8 +1449,8 @@ FormatData/ar_LY/DayNames/3=\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621 FormatData/ar_LY/DayNames/4=\u0627\u0644\u062e\u0645\u064a\u0633 FormatData/ar_LY/DayNames/5=\u0627\u0644\u062c\u0645\u0639\u0629 FormatData/ar_LY/DayNames/6=\u0627\u0644\u0633\u0628\u062a -CalendarData/ar_LY/firstDayOfWeek=7 -CalendarData/ar_LY/minimalDaysInFirstWeek=1 +CalendarData/ar_LY/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/ar_LY/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA FormatData/ar_LY/MonthAbbreviations/0=\u064a\u0646\u0627\u064a\u0631 FormatData/ar_LY/MonthAbbreviations/1=\u0641\u0628\u0631\u0627\u064a\u0631 FormatData/ar_LY/MonthAbbreviations/2=\u0645\u0627\u0631\u0633 @@ -1537,8 +1537,8 @@ FormatData/ar_MA/DayNames/3=\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621 FormatData/ar_MA/DayNames/4=\u0627\u0644\u062e\u0645\u064a\u0633 FormatData/ar_MA/DayNames/5=\u0627\u0644\u062c\u0645\u0639\u0629 FormatData/ar_MA/DayNames/6=\u0627\u0644\u0633\u0628\u062a -CalendarData/ar_MA/firstDayOfWeek=7 -CalendarData/ar_MA/minimalDaysInFirstWeek=1 +CalendarData/ar_MA/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/ar_MA/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA FormatData/ar_MA/MonthAbbreviations/0=\u064a\u0646\u0627\u064a\u0631 FormatData/ar_MA/MonthAbbreviations/1=\u0641\u0628\u0631\u0627\u064a\u0631 FormatData/ar_MA/MonthAbbreviations/2=\u0645\u0627\u0631\u0633 @@ -1625,8 +1625,8 @@ FormatData/ar_OM/DayNames/3=\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621 FormatData/ar_OM/DayNames/4=\u0627\u0644\u062e\u0645\u064a\u0633 FormatData/ar_OM/DayNames/5=\u0627\u0644\u062c\u0645\u0639\u0629 FormatData/ar_OM/DayNames/6=\u0627\u0644\u0633\u0628\u062a -CalendarData/ar_OM/firstDayOfWeek=7 -CalendarData/ar_OM/minimalDaysInFirstWeek=1 +CalendarData/ar_OM/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/ar_OM/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA FormatData/ar_OM/MonthAbbreviations/0=\u064a\u0646\u0627\u064a\u0631 FormatData/ar_OM/MonthAbbreviations/1=\u0641\u0628\u0631\u0627\u064a\u0631 FormatData/ar_OM/MonthAbbreviations/2=\u0645\u0627\u0631\u0633 @@ -1713,8 +1713,8 @@ FormatData/ar_QA/DayNames/3=\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621 FormatData/ar_QA/DayNames/4=\u0627\u0644\u062e\u0645\u064a\u0633 FormatData/ar_QA/DayNames/5=\u0627\u0644\u062c\u0645\u0639\u0629 FormatData/ar_QA/DayNames/6=\u0627\u0644\u0633\u0628\u062a -CalendarData/ar_QA/firstDayOfWeek=7 -CalendarData/ar_QA/minimalDaysInFirstWeek=1 +CalendarData/ar_QA/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/ar_QA/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA FormatData/ar_QA/MonthAbbreviations/0=\u064a\u0646\u0627\u064a\u0631 FormatData/ar_QA/MonthAbbreviations/1=\u0641\u0628\u0631\u0627\u064a\u0631 FormatData/ar_QA/MonthAbbreviations/2=\u0645\u0627\u0631\u0633 @@ -1801,8 +1801,8 @@ FormatData/ar_SA/DayNames/3=\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621 FormatData/ar_SA/DayNames/4=\u0627\u0644\u062e\u0645\u064a\u0633 FormatData/ar_SA/DayNames/5=\u0627\u0644\u062c\u0645\u0639\u0629 FormatData/ar_SA/DayNames/6=\u0627\u0644\u0633\u0628\u062a -CalendarData/ar_SA/firstDayOfWeek=1 -CalendarData/ar_SA/minimalDaysInFirstWeek=1 +CalendarData/ar_SA/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/ar_SA/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA FormatData/ar_SA/MonthAbbreviations/0=\u064a\u0646\u0627\u064a\u0631 FormatData/ar_SA/MonthAbbreviations/1=\u0641\u0628\u0631\u0627\u064a\u0631 FormatData/ar_SA/MonthAbbreviations/2=\u0645\u0627\u0631\u0633 @@ -1890,8 +1890,8 @@ FormatData/ar_SD/DayNames/3=\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621 FormatData/ar_SD/DayNames/4=\u0627\u0644\u062e\u0645\u064a\u0633 FormatData/ar_SD/DayNames/5=\u0627\u0644\u062c\u0645\u0639\u0629 FormatData/ar_SD/DayNames/6=\u0627\u0644\u0633\u0628\u062a -CalendarData/ar_SD/firstDayOfWeek=7 -CalendarData/ar_SD/minimalDaysInFirstWeek=1 +CalendarData/ar_SD/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/ar_SD/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA FormatData/ar_SD/MonthAbbreviations/0=\u064a\u0646\u0627\u064a\u0631 FormatData/ar_SD/MonthAbbreviations/1=\u0641\u0628\u0631\u0627\u064a\u0631 FormatData/ar_SD/MonthAbbreviations/2=\u0645\u0627\u0631\u0633 @@ -2011,8 +2011,8 @@ FormatData/ar_SY/DayNames/3=\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621 FormatData/ar_SY/DayNames/4=\u0627\u0644\u062e\u0645\u064a\u0633 FormatData/ar_SY/DayNames/5=\u0627\u0644\u062c\u0645\u0639\u0629 FormatData/ar_SY/DayNames/6=\u0627\u0644\u0633\u0628\u062a -CalendarData/ar_SY/firstDayOfWeek=7 -CalendarData/ar_SY/minimalDaysInFirstWeek=1 +CalendarData/ar_SY/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/ar_SY/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA FormatData/ar_SY/Eras/0=\u0642.\u0645 FormatData/ar_SY/Eras/1=\u0645 LocaleNames/ar_SY/ar=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 @@ -2066,8 +2066,8 @@ FormatData/ar_TN/DayNames/3=\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621 FormatData/ar_TN/DayNames/4=\u0627\u0644\u062e\u0645\u064a\u0633 FormatData/ar_TN/DayNames/5=\u0627\u0644\u062c\u0645\u0639\u0629 FormatData/ar_TN/DayNames/6=\u0627\u0644\u0633\u0628\u062a -CalendarData/ar_TN/firstDayOfWeek=1 -CalendarData/ar_TN/minimalDaysInFirstWeek=1 +CalendarData/ar_TN/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/ar_TN/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA FormatData/ar_TN/MonthAbbreviations/0=\u062c\u0627\u0646\u0641\u064a FormatData/ar_TN/MonthAbbreviations/1=\u0641\u064a\u0641\u0631\u064a FormatData/ar_TN/MonthAbbreviations/2=\u0645\u0627\u0631\u0633 @@ -2154,8 +2154,8 @@ FormatData/ar_YE/DayNames/3=\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621 FormatData/ar_YE/DayNames/4=\u0627\u0644\u062e\u0645\u064a\u0633 FormatData/ar_YE/DayNames/5=\u0627\u0644\u062c\u0645\u0639\u0629 FormatData/ar_YE/DayNames/6=\u0627\u0644\u0633\u0628\u062a -CalendarData/ar_YE/firstDayOfWeek=1 -CalendarData/ar_YE/minimalDaysInFirstWeek=1 +CalendarData/ar_YE/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/ar_YE/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA FormatData/ar_YE/MonthAbbreviations/0=\u064a\u0646\u0627\u064a\u0631 FormatData/ar_YE/MonthAbbreviations/1=\u0641\u0628\u0631\u0627\u064a\u0631 FormatData/ar_YE/MonthAbbreviations/2=\u0645\u0627\u0631\u0633 @@ -2341,9 +2341,9 @@ FormatData/fr_FR/MonthAbbreviations/9=oct. FormatData/fr_FR/MonthAbbreviations/10=nov. FormatData/fr_FR/MonthAbbreviations/11=d\u00e9c. FormatData/fr_FR/MonthAbbreviations/12= -CalendarData/fr_FR/firstDayOfWeek=2 +CalendarData/fr_FR/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY # next line changed according the 4518811 bug -CalendarData/fr_FR/minimalDaysInFirstWeek=4 +CalendarData/fr_FR/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA FormatData/fr_FR/AmPmMarkers/0=AM FormatData/fr_FR/AmPmMarkers/1=PM @@ -2488,19 +2488,19 @@ CurrencyNames/ru_RU/RUB=\u20bd LocaleNames/ru_RU/MM=\u041c\u044c\u044f\u043d\u043c\u0430 (\u0411\u0438\u0440\u043c\u0430) #bug 4518811 -CalendarData/ca_ES/minimalDaysInFirstWeek=4 -CalendarData/cs_CZ/minimalDaysInFirstWeek=4 -CalendarData/da_DK/minimalDaysInFirstWeek=4 -CalendarData/de_AT/minimalDaysInFirstWeek=4 -CalendarData/el_GR/minimalDaysInFirstWeek=4 -CalendarData/en_IE/minimalDaysInFirstWeek=4 -CalendarData/es_ES/minimalDaysInFirstWeek=4 -CalendarData/et_EE/minimalDaysInFirstWeek=4 -CalendarData/fi_FI/minimalDaysInFirstWeek=4 -CalendarData/is_IS/minimalDaysInFirstWeek=4 -CalendarData/lt_LT/minimalDaysInFirstWeek=4 -CalendarData/pl_PL/minimalDaysInFirstWeek=4 -CalendarData/pt_PT/minimalDaysInFirstWeek=4 +CalendarData/ca_ES/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/cs_CZ/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/da_DK/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/de_AT/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/el_GR/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/en_IE/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/es_ES/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/et_EE/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/fi_FI/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/is_IS/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/lt_LT/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/pl_PL/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/pt_PT/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA #bug 4945388 CurrencyNames/be_BY/BYR=\u0440. @@ -2523,7 +2523,7 @@ FormatData/bg/DayNames/4=\u0447\u0435\u0442\u0432\u044a\u0440\u0442\u044a\u043a LocaleNames/zh/tw=\u7279\u5a01\u6587 #bug 6277020 -CalendarData/ca_ES/firstDayOfWeek=2 +CalendarData/ca_ES/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY #bug 6277696 #zh_SG, id, id_ID, en_MT, mt_MT, en_PH, el, el_CY, ms, ms_MY @@ -3324,7 +3324,7 @@ LocaleNames/el_CY/ZM=\u0396\u03ac\u03bc\u03c0\u03b9\u03b1 LocaleNames/el_CY/ZW=\u0396\u03b9\u03bc\u03c0\u03ac\u03bc\u03c0\u03bf\u03c5\u03b5 #CurrencyNames/el_CY/CYP= CurrencyNames/el_CY/EUR=\u20ac -CalendarData/el_CY/minimalDaysInFirstWeek=1 +CalendarData/el_CY/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA #ms_MY and ms FormatData/ms_MY/NumberPatterns/0=#,##0.### @@ -3538,7 +3538,7 @@ LocaleNames/es_US/TK=Tokelau LocaleNames/es_US/TT=Trinidad y Tobago LocaleNames/es_US/VI=Islas V\u00edrgenes de EE. UU. CurrencyNames/es_US/USD=$ -CalendarData/es_US/firstDayOfWeek=1 +CalendarData/es_US/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY #bug 4400849 LocaleNames/pt/aa=afar LocaleNames/pt/ab=abc\u00e1zio @@ -5389,13 +5389,13 @@ FormatData/mt/AmPmMarkers/0=AM FormatData/mt/AmPmMarkers/1=PM FormatData/mt/DatePatterns/0=EEEE, d 'ta'\u2019 MMMM y # bug# 6483191 -CalendarData/ga_IE/firstDayOfWeek=1 -CalendarData/en_PH/firstDayOfWeek=1 -CalendarData/en_SG/firstDayOfWeek=1 -CalendarData/zh_SG/firstDayOfWeek=1 -CalendarData/mt_MT/firstDayOfWeek=1 -CalendarData/en_MT/firstDayOfWeek=1 -CalendarData/es_US/firstDayOfWeek=1 +CalendarData/ga_IE/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/en_PH/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/en_SG/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/zh_SG/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/mt_MT/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/en_MT/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/es_US/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY #CalendarData/es_CY/firstDayOfWeek= #CalendarData/in_ID/firstDayOfWeek= #CalendarData/ms_MY/firstDayOfWeek= @@ -6122,14 +6122,14 @@ LocaleNames/nl/ZM=Zambia # bug 6998391 #CalendarData/sr-Latn/firstDayOfWeek= -CalendarData/sr-Latn-BA/firstDayOfWeek=2 -CalendarData/sr-Latn-ME/firstDayOfWeek=2 -CalendarData/sr-Latn-RS/firstDayOfWeek=2 +CalendarData/sr-Latn-BA/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/sr-Latn-ME/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/sr-Latn-RS/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY # #CalendarData/sr-Latn/minimalDaysInFirstWeek= -CalendarData/sr-Latn-BA/minimalDaysInFirstWeek=1 -CalendarData/sr-Latn-ME/minimalDaysInFirstWeek=1 -CalendarData/sr-Latn-RS/minimalDaysInFirstWeek=1 +CalendarData/sr-Latn-BA/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/sr-Latn-ME/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/sr-Latn-RS/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA # LocaleNames/sr-Latn/SR=Surinam LocaleNames/sr-Latn-BA/SR=Surinam @@ -8303,79 +8303,79 @@ FormatData/kea_CV/latn.NumberElements/1=\u00a0 # bug #8185841 -CalendarData/az-Latn-AZ/firstDayOfWeek=2 -CalendarData/az-Latn-AZ/minimalDaysInFirstWeek=1 -CalendarData/az-Cyrl-AZ/firstDayOfWeek=2 -CalendarData/az-Cyrl-AZ/minimalDaysInFirstWeek=1 -CalendarData/az_AZ/firstDayOfWeek=2 -CalendarData/az-AZ/minimalDaysInFirstWeek=1 -CalendarData/bs-Cyrl-BA/firstDayOfWeek=2 -CalendarData/bs-Cyrl-BA/minimalDaysInFirstWeek=1 -CalendarData/bs_BA/firstDayOfWeek=2 -CalendarData/bs_BA/minimalDaysInFirstWeek=1 -CalendarData/pa-Arab-PK/firstDayOfWeek=1 -CalendarData/pa-Arab-PK/minimalDaysInFirstWeek=1 -CalendarData/pa_PK/firstDayOfWeek=1 -CalendarData/pa_PK/minimalDaysInFirstWeek=1 -CalendarData/pa-Guru-IN/firstDayOfWeek=1 -CalendarData/pa-Guru-IN/minimalDaysInFirstWeek=1 -CalendarData/pa_IN/firstDayOfWeek=1 -CalendarData/pa_IN/minimalDaysInFirstWeek=1 -CalendarData/shi-Latn-MA/firstDayOfWeek=7 -CalendarData/shi-Latn-MA/minimalDaysInFirstWeek=1 -CalendarData/shi-Tfng-MA/firstDayOfWeek=7 -CalendarData/shi-Tfng-MA/minimalDaysInFirstWeek=1 -CalendarData/shi_MA/firstDayOfWeek=7 -CalendarData/shi_MA/minimalDaysInFirstWeek=1 -CalendarData/sr-Cyrl-BA/firstDayOfWeek=2 -CalendarData/sr-Cyrl-BA/minimalDaysInFirstWeek=1 -CalendarData/sr-Cyrl-ME/firstDayOfWeek=2 -CalendarData/sr-Cyrl-ME/minimalDaysInFirstWeek=1 -CalendarData/sr-Cyrl-RS/firstDayOfWeek=2 -CalendarData/sr-Cyrl-RS/minimalDaysInFirstWeek=1 -CalendarData/sr-Cyrl-XK/firstDayOfWeek=2 -CalendarData/sr-Cyrl-XK/minimalDaysInFirstWeek=1 -CalendarData/sr_RS/firstDayOfWeek=2 -CalendarData/sr_RS/minimalDaysInFirstWeek=1 -CalendarData/sr_BA/firstDayOfWeek=2 -CalendarData/sr_BA/minimalDaysInFirstWeek=1 -CalendarData/sr_ME/firstDayOfWeek=2 -CalendarData/sr_ME/minimalDaysInFirstWeek=1 -CalendarData/sr_XK/firstDayOfWeek=2 -CalendarData/sr_XK/minimalDaysInFirstWeek=1 -CalendarData/uz-Arab-AF/firstDayOfWeek=7 -CalendarData/uz-Arab-AF/minimalDaysInFirstWeek=1 -CalendarData/uz-Cyrl-UZ/firstDayOfWeek=2 -CalendarData/uz-Cyrl-UZ/minimalDaysInFirstWeek=1 -CalendarData/uz-Latn-UZ/firstDayOfWeek=2 -CalendarData/uz-Latn-UZ/minimalDaysInFirstWeek=1 -CalendarData/vai-Latn-LR/firstDayOfWeek=2 -CalendarData/vai-Latn-LR/minimalDaysInFirstWeek=1 -CalendarData/vai-Vaii-LR/firstDayOfWeek=2 -CalendarData/vai-Vaii-LR/minimalDaysInFirstWeek=1 -CalendarData/vai_LR/firstDayOfWeek=2 -CalendarData/vai_LR/minimalDaysInFirstWeek=1 -CalendarData/uz_UZ/firstDayOfWeek=2 -CalendarData/uz_UZ/minimalDaysInFirstWeek=1 -CalendarData/zh_CN/firstDayOfWeek=1 -CalendarData/zh_CN/minimalDaysInFirstWeek=1 -CalendarData/zh-Hans-CN/minimalDaysInFirstWeek=1 -CalendarData/zh-Hans-CN/firstDayOfWeek=1 -CalendarData/zh-Hans-HK/firstDayOfWeek=1 -CalendarData/zh-Hans-HK/minimalDaysInFirstWeek=1 -CalendarData/zh-Hans-MO/minimalDaysInFirstWeek=1 -CalendarData/zh-Hans-MO/firstDayOfWeek=1 -CalendarData/zh-Hans-SG/firstDayOfWeek=1 -CalendarData/zh-Hans-SG/minimalDaysInFirstWeek=1 -CalendarData/zh-Hant-HK/minimalDaysInFirstWeek=1 -CalendarData/zh-Hant-HK/firstDayOfWeek=1 -CalendarData/zh-Hant-TW/minimalDaysInFirstWeek=1 -CalendarData/zh-Hant-TW/firstDayOfWeek=1 -CalendarData/zh_HK/minimalDaysInFirstWeek=1 -CalendarData/zh_HK/firstDayOfWeek=1 -CalendarData/zh_MO/minimalDaysInFirstWeek=1 -CalendarData/zh_MO/firstDayOfWeek=1 -CalendarData/zh_SG/minimalDaysInFirstWeek=1 -CalendarData/zh_SG/firstDayOfWeek=1 -CalendarData/zh_TW/firstDayOfWeek=1 -CalendarData/zh_TW/minimalDaysInFirstWeek=1 +CalendarData/az-Latn-AZ/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/az-Latn-AZ/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/az-Cyrl-AZ/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/az-Cyrl-AZ/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/az_AZ/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/az-AZ/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/bs-Cyrl-BA/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/bs-Cyrl-BA/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/bs_BA/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/bs_BA/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/pa-Arab-PK/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/pa-Arab-PK/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/pa_PK/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/pa_PK/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/pa-Guru-IN/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/pa-Guru-IN/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/pa_IN/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/pa_IN/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/shi-Latn-MA/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/shi-Latn-MA/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/shi-Tfng-MA/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/shi-Tfng-MA/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/shi_MA/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/shi_MA/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/sr-Cyrl-BA/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/sr-Cyrl-BA/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/sr-Cyrl-ME/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/sr-Cyrl-ME/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/sr-Cyrl-RS/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/sr-Cyrl-RS/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/sr-Cyrl-XK/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/sr-Cyrl-XK/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/sr_RS/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/sr_RS/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/sr_BA/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/sr_BA/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/sr_ME/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/sr_ME/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/sr_XK/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/sr_XK/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/uz-Arab-AF/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/uz-Arab-AF/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/uz-Cyrl-UZ/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/uz-Cyrl-UZ/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/uz-Latn-UZ/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/uz-Latn-UZ/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/vai-Latn-LR/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/vai-Latn-LR/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/vai-Vaii-LR/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/vai-Vaii-LR/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/vai_LR/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/vai_LR/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/uz_UZ/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/uz_UZ/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/zh_CN/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/zh_CN/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/zh-Hans-CN/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/zh-Hans-CN/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/zh-Hans-HK/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/zh-Hans-HK/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/zh-Hans-MO/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/zh-Hans-MO/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/zh-Hans-SG/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/zh-Hans-SG/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/zh-Hant-HK/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/zh-Hant-HK/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/zh-Hant-TW/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/zh-Hant-TW/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/zh_HK/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/zh_HK/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/zh_MO/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/zh_MO/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/zh_SG/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA +CalendarData/zh_SG/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/zh_TW/firstDayOfWeek=1: AG AR AS AU BR BS BT BW BZ CA CN CO DM DO ET GT GU HK HN ID IE IL IN JM JP KE KH KR LA MH MM MO MT MX MZ NI NP NZ PA PE PH PK PR PY SA SG SV TH TN TT TW UM US VE VI WS YE ZA ZW;2: 001 AD AI AL AM AN AT AX AZ BA BE BG BM BN BY CH CL CM CR CY CZ DE DK EC EE ES FI FJ FO FR GB GE GF GP GR HR HU IS IT KG KZ LB LI LK LT LU LV MC MD ME MK MN MQ MY NL NO PL PT RE RO RS RU SE SI SK SM TJ TM TR UA UY UZ VA VN XK;6: BD MV;7: AE AF BH DJ DZ EG IQ IR JO KW LY MA OM QA SD SY +CalendarData/zh_TW/minimalDaysInFirstWeek=1: 001 GU UM US VI;4: AD AN AT AX BE BG CH CZ DE DK EE ES FI FJ FO FR GB GF GG GI GP GR HU IE IM IS IT JE LI LT LU MC MQ NL NO PL PT RE SE SJ SK SM VA diff --git a/test/jdk/sun/text/resources/LocaleDataTest.java b/test/jdk/sun/text/resources/LocaleDataTest.java index 1549b65d911..3a0f969875f 100644 --- a/test/jdk/sun/text/resources/LocaleDataTest.java +++ b/test/jdk/sun/text/resources/LocaleDataTest.java @@ -37,7 +37,7 @@ * 7003124 7085757 7028073 7171028 7189611 8000983 7195759 8004489 8006509 * 7114053 7074882 7040556 8008577 8013836 8021121 6192407 6931564 8027695 * 8017142 8037343 8055222 8042126 8074791 8075173 8080774 8129361 8134916 - * 8145136 8145952 8164784 8037111 8081643 7037368 8178872 8185841 + * 8145136 8145952 8164784 8037111 8081643 7037368 8178872 8185841 8190918 * @summary Verify locale data * @modules java.base/sun.util.resources * @modules jdk.localedata diff --git a/test/jdk/tools/jlink/plugins/IncludeLocalesPluginTest.java b/test/jdk/tools/jlink/plugins/IncludeLocalesPluginTest.java index c6863202991..26f97966a47 100644 --- a/test/jdk/tools/jlink/plugins/IncludeLocalesPluginTest.java +++ b/test/jdk/tools/jlink/plugins/IncludeLocalesPluginTest.java @@ -40,7 +40,7 @@ import tests.Result; /* * @test - * @bug 8152143 8152704 8155649 8165804 8185841 + * @bug 8152143 8152704 8155649 8165804 8185841 8176841 8190918 * @summary IncludeLocalesPlugin tests * @author Naoto Sato * @library ../../lib @@ -70,6 +70,14 @@ public class IncludeLocalesPluginTest { private static int errors; private final static Object[][] testData = { + // Test data should include: + // - --include-locales command line option + // - --add-modules command line option values + // - List of required resources in the result image + // - List of resources that should not exist in the result image + // - List of available locales in the result image + // - Error message + // without --include-locales option: should include all locales { "", @@ -227,11 +235,8 @@ public class IncludeLocalesPluginTest { List.of( "/jdk.localedata/sun/text/resources/ext/FormatData_en_IN.class", "/jdk.localedata/sun/text/resources/ext/FormatData_hi_IN.class", - "/jdk.localedata/sun/util/resources/cldr/ext/CalendarData_as_IN.class", "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_001.class", - "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_IN.class", - "/jdk.localedata/sun/util/resources/cldr/ext/CalendarData_kok_IN.class", - "/jdk.localedata/sun/util/resources/cldr/ext/CalendarData_pa_IN.class"), + "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_IN.class"), List.of( "/jdk.localedata/sun/text/resources/ext/LineBreakIteratorData_th", "/jdk.localedata/sun/text/resources/ext/thai_dict", @@ -242,6 +247,7 @@ public class IncludeLocalesPluginTest { "/jdk.localedata/sun/text/resources/ext/FormatData_ja.class", "/jdk.localedata/sun/text/resources/ext/FormatData_th.class", "/jdk.localedata/sun/text/resources/ext/FormatData_zh.class", + "/jdk.localedata/sun/util/resources/cldr/ext/CalendarData_as_IN.class", "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ja.class", "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_th.class", "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_zh.class"), @@ -327,7 +333,7 @@ public class IncludeLocalesPluginTest { "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_th.class"), List.of( "(root)", "en", "en_US", "en_US_POSIX", "zh", "zh__#Hans", "zh_CN", - "zh_HK", "zh_MO", "zh_CN_#Hans", "zh_HK_#Hans", "zh_MO_#Hans", "zh_SG", "zh_SG_#Hans"), + "zh_CN_#Hans", "zh_HK_#Hans", "zh_MO_#Hans", "zh_SG", "zh_SG_#Hans"), "", }, @@ -387,6 +393,34 @@ public class IncludeLocalesPluginTest { "", }, + // Langtag including extensions. Should be ignored. + { + "--include-locales=en,ja-u-nu-thai", + "jdk.localedata", + List.of( + "/jdk.localedata/sun/text/resources/ext/FormatData_en_GB.class", + "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_en_001.class"), + List.of( + "/jdk.localedata/sun/text/resources/cldr/ext/FormatData_ja.class", + "/jdk.localedata/sun/text/resources/ext/FormatData_th.class"), + List.of( + "(root)", "en", "en_001", "en_150", "en_AG", "en_AI", "en_AS", "en_AT", + "en_AU", "en_BB", "en_BE", "en_BI", "en_BM", "en_BS", "en_BW", "en_BZ", + "en_CA", "en_CC", "en_CH", "en_CK", "en_CM", "en_CX", "en_CY", "en_DE", + "en_DG", "en_DK", "en_DM", "en_ER", "en_FI", "en_FJ", "en_FK", "en_FM", + "en_GB", "en_GD", "en_GG", "en_GH", "en_GI", "en_GM", "en_GU", "en_GY", + "en_HK", "en_IE", "en_IL", "en_IM", "en_IN", "en_IO", "en_JE", "en_JM", + "en_KE", "en_KI", "en_KN", "en_KY", "en_LC", "en_LR", "en_LS", "en_MG", + "en_MH", "en_MO", "en_MP", "en_MS", "en_MT", "en_MU", "en_MW", "en_MY", + "en_NA", "en_NF", "en_NG", "en_NL", "en_NR", "en_NU", "en_NZ", "en_PG", + "en_PH", "en_PK", "en_PN", "en_PR", "en_PW", "en_RW", "en_SB", "en_SC", + "en_SD", "en_SE", "en_SG", "en_SH", "en_SI", "en_SL", "en_SS", "en_SX", + "en_SZ", "en_TC", "en_TK", "en_TO", "en_TT", "en_TV", "en_TZ", "en_UG", + "en_UM", "en_US", "en_US_POSIX", "en_VC", "en_VG", "en_VI", "en_VU", + "en_WS", "en_ZA", "en_ZM", "en_ZW"), + "", + }, + // Error case: No matching locales { "--include-locales=xyz",