Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLDR-17402 json: drop _cldrVersion path #3863

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@ private Map<JSONSection, List<CldrItem>> 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<String> activeNumberingSystems = new TreeSet<>();
activeNumberingSystems.add("latn"); // Always include latin script numbers
for (String np : LdmlConvertRules.ACTIVE_NUMBERING_SYSTEM_XPATHS) {
Expand Down Expand Up @@ -588,11 +589,19 @@ private Map<JSONSection, List<CldrItem>> 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()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Loading