< prev index next >

make/jdk/src/classes/build/tools/cldrconverter/LDMLParseHandler.java

Print this page
rev 49854 : 8181157: CLDR Timezone name fallback implementation
Reviewed-by: sherman

*** 1,7 **** /* ! * 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2012, 2018, 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
*** 101,123 **** 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 // --- 101,134 ---- break; case "key": // for LocaleNames // copy string + { + String key = convertOldKeyName(attributes.getValue("type")); + if (key.length() == 2) { pushStringEntry(qName, attributes, ! CLDRConverter.LOCALE_KEY_PREFIX + key); ! } else { ! pushIgnoredContainer(qName); ! } ! } break; case "type": // for LocaleNames/CalendarNames // copy string + { + String key = convertOldKeyName(attributes.getValue("key")); + if (key.length() == 2) { pushStringEntry(qName, attributes, ! CLDRConverter.LOCALE_TYPE_PREFIX + key + "." + attributes.getValue("type")); ! } else { ! pushIgnoredContainer(qName); ! } ! } break; // // Currency information //
*** 443,452 **** --- 454,473 ---- pushStringEntry(qName, attributes, "timezone.hourFormat"); break; case "gmtFormat": pushStringEntry(qName, attributes, "timezone.gmtFormat"); break; + case "gmtZeroFormat": + pushStringEntry(qName, attributes, "timezone.gmtZeroFormat"); + break; + case "regionFormat": + { + String type = attributes.getValue("type"); + pushStringEntry(qName, attributes, "timezone.regionFormat" + + (type == null ? "" : "." + type)); + } + break; case "zone": { String tzid = attributes.getValue("type"); // Olson tz id zonePrefix = CLDRConverter.TIMEZONE_ID_PREFIX; put(zonePrefix + tzid, new HashMap<String, String>());
*** 472,483 **** case "generic": // generic name case "standard": // standard time name case "daylight": // daylight saving (summer) time name pushStringEntry(qName, attributes, CLDRConverter.ZONE_NAME_PREFIX + qName + "." + zoneNameStyle); break; ! case "exemplarCity": // not used in JDK ! pushIgnoredContainer(qName); break; // // Number format information // --- 493,504 ---- case "generic": // generic name case "standard": // standard time name case "daylight": // daylight saving (summer) time name pushStringEntry(qName, attributes, CLDRConverter.ZONE_NAME_PREFIX + qName + "." + zoneNameStyle); break; ! case "exemplarCity": ! pushStringEntry(qName, attributes, CLDRConverter.EXEMPLAR_CITY_PREFIX); break; // // Number format information //
*** 875,890 **** --- 896,916 ---- break; case "generic": case "standard": case "daylight": + case "exemplarCity": if (zonePrefix != null && (currentContainer instanceof Entry)) { @SuppressWarnings("unchecked") Map<String, String> valmap = (Map<String, String>) get(zonePrefix + getContainerKey()); Entry<?> entry = (Entry<?>) currentContainer; + if (qName.equals("exemplarCity")) { + put(CLDRConverter.EXEMPLAR_CITY_PREFIX + getContainerKey(), (String) entry.getValue()); + } else { valmap.put(entry.getKey(), (String) entry.getValue()); } + } break; case "monthWidth": case "dayWidth": case "dayPeriodWidth":
< prev index next >