diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/json/Ldml2JsonConverter.java b/tools/cldr-code/src/main/java/org/unicode/cldr/json/Ldml2JsonConverter.java index 0857be52332..35c413c1019 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/json/Ldml2JsonConverter.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/json/Ldml2JsonConverter.java @@ -540,6 +540,7 @@ private Map> mapPathsToSections( Matcher noNumberingSystemMatcher = LdmlConvertRules.NO_NUMBERING_SYSTEM_PATTERN.matcher(""); Matcher numberingSystemMatcher = LdmlConvertRules.NUMBERING_SYSTEM_PATTERN.matcher(""); Matcher rootIdentityMatcher = LdmlConvertRules.ROOT_IDENTITY_PATTERN.matcher(""); + Matcher versionMatcher = LdmlConvertRules.VERSION_PATTERN.matcher(""); Set activeNumberingSystems = new TreeSet<>(); activeNumberingSystems.add("latn"); // Always include latin script numbers for (String np : LdmlConvertRules.ACTIVE_NUMBERING_SYSTEM_XPATHS) { @@ -588,11 +589,19 @@ private Map> mapPathsToSections( continue; } // Discard root identity element unless the locale is root + // TODO: CLDR-17790 this code should not be needed. rootIdentityMatcher.reset(fullPath); if (rootIdentityMatcher.matches() && !"root".equals(locID)) { continue; } + // discard version stuff + versionMatcher.reset(fullPath); + if (versionMatcher.matches()) { + // drop //ldml/identity/version entirely. + continue; + } + // automatically filter out number symbols and formats without a numbering system noNumberingSystemMatcher.reset(fullPath); if (noNumberingSystemMatcher.matches()) { diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/json/LdmlConvertRules.java b/tools/cldr-code/src/main/java/org/unicode/cldr/json/LdmlConvertRules.java index e1eb03ec4e1..7e890aa5052 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/json/LdmlConvertRules.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/json/LdmlConvertRules.java @@ -422,6 +422,12 @@ public static class SplittableAttributeSpec { public static final Pattern ROOT_IDENTITY_PATTERN = Pattern.compile("//ldml/identity/language\\[@type=\"root\"\\]"); + /** + * Version (coming from DTD) should be discarded everywhere. This information is now in + * package.json. + */ + public static final Pattern VERSION_PATTERN = Pattern.compile("//ldml/identity/version.*"); + /** A simple class to hold the specification of a path transformation. */ public static class PathTransformSpec {