Skip to content

Commit

Permalink
CLDR-16720 json xlit WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
srl295 committed Sep 5, 2024
1 parent eb4b003 commit c40e462
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static CldrNode createNode(
String fullTrunk = extractAttrs(fullPathSegment, node.nondistinguishingAttributes);
if (!node.name.equals(fullTrunk)) {
throw new ParseException(
"Error in parsing \"" + pathSegment + " \":\"" + fullPathSegment, 0);
"Error in parsing \"" + pathSegment + "\":\"" + fullPathSegment + " - " + node.name + " != " + fullTrunk, 0);
}

for (String key : node.distinguishingAttributes.keySet()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ enum RunType {
rbnf(false, true),
annotations,
annotationsDerived,
bcp47(false, false);
bcp47(false, false),
transforms(false, false);

private final boolean isTiered;
private final boolean hasLocales;
Expand Down Expand Up @@ -739,6 +740,8 @@ private int convertCldrItems(
outFilename = filenameAsLangTag + ".json";
} else if (type == RunType.bcp47) {
outFilename = filename + ".json";
} else if (type == RunType.transforms) {
outFilename = filename + ".json";
} else if (js.section.equals("other")) {
// If you see other-___.json, it means items that were missing from
// JSON_config_*.txt
Expand Down Expand Up @@ -884,6 +887,13 @@ private int convertCldrItems(
}
}


if (item.getUntransformedPath().startsWith("//supplementalData/transforms")) {
System.out.println("item :" + item);
continue; // TODO
}


// some items need to be split to multiple item before processing. None
// of those items need to be sorted.
// Applies to SPLITTABLE_ATTRS attributes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ class LdmlConvertRules {
"pluralRules:pluralRule:count",
"languageMatches:languageMatch:desired",
"styleNames:styleName:subtype",
"styleNames:styleName:alt");
"styleNames:styleName:alt",
// transforms
"transforms:transform:source",
"transforms:transform:target",
"transforms:transform:direction"
);

/**
* The set of attributes that should become part of the name in form of
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
section=transforms ; path=//cldr/supplemental/transforms/.* ; package=transforms ; packageDesc=Transform data
dependency=core ; package=transforms

0 comments on commit c40e462

Please sign in to comment.