Skip to content

Commit

Permalink
CLDR-14571 json: improve format of metazone short alias (#1489)
Browse files Browse the repository at this point in the history
- omit _deprecated:false (the default)
- use _deprecated: true (a boolean instead of string)
- remove debugging string

Also:
- CLDR-14607: whitespace fix in DTD
  • Loading branch information
srl295 authored Sep 8, 2021
1 parent 2875bb6 commit 4b121e3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion common/dtd/ldmlSupplemental.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@ CLDR data files are interpreted according to the LDML specification (http://unic
<!ATTLIST metazoneId longId CDATA #IMPLIED >
<!--@MATCH:metazone-->
<!--@VALUE-->
<!ATTLIST metazoneId deprecated (true | false) "false" >
<!ATTLIST metazoneId deprecated (true | false) "false" >
<!--@VALUE-->
<!ATTLIST metazoneId preferred NMTOKEN #IMPLIED >
<!--@MATCH:metazone-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,6 @@ private void startNonleafNode(JsonWriter out, CldrNode node, int level)
out.name(attrAsKey).value(v);
} // else, omit
} else {
System.err.println(node.getUntransformedPath()+ "@BOOOOL@"+ node.getName() +":"+ node.getParent() +":"+ key+"="+rawAttrValue);
out.name(attrAsKey).value(value);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,15 +597,15 @@ public static final boolean valueIsSpacesepArray(final String nodeName, String p
|| (parent!=null && CHILD_VALUE_IS_SPACESEP_ARRAY.contains(parent));
}

static final Set<String> BCP47_BOOLEAN_OMIT_FALSE = ImmutableSet.of(
static final Set<String> BOOLEAN_OMIT_FALSE = ImmutableSet.of(
// attribute names within bcp47 that are booleans, but omitted if false.
"deprecated"
);

// These attributes are booleans, and should be omitted if false
public static final boolean attrIsBooleanOmitFalse(final String fullPath, final String nodeName, final String parent, final String key) {
return (fullPath != null &&
(fullPath.startsWith("//ldmlBCP47/keyword/key") &&
BCP47_BOOLEAN_OMIT_FALSE.contains(key)));
(fullPath.startsWith("//supplementalData/metaZones/metazoneIds") &&
BOOLEAN_OMIT_FALSE.contains(key)));
}
}

0 comments on commit 4b121e3

Please sign in to comment.