Skip to content

Commit

Permalink
CLDR-17285 json: add cldrVersion and unicodeVersion to package.json
Browse files Browse the repository at this point in the history
- see also CLDR-17402
  • Loading branch information
srl295 committed Feb 26, 2024
1 parent 1259519 commit 1340032
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1386,6 +1386,10 @@ public void writePackageJson(String outputDir, String packageName) throws IOExce
obj.addProperty("license", CLDRURLS.UNICODE_SPDX);
obj.addProperty("bugs", CLDRURLS.CLDR_NEWTICKET_URL);

final SupplementalDataInfo sdi = CLDRConfig.getInstance().getSupplementalDataInfo();
obj.addProperty("cldrVersion", sdi.getCldrVersionString());
obj.addProperty("unicodeVersion", sdi.getUnicodeVersionString());

outf.println(gson.toJson(obj));
outf.close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,9 @@ public enum RBNFGroup {

private VersionInfo cldrVersion;

private String cldrVersionString = null;
private String unicodeVersion = null;

private Map<String, PopulationData> territoryToPopulationData = new TreeMap<>();

private Map<String, Map<String, PopulationData>> territoryToLanguageToPopulationData =
Expand Down Expand Up @@ -1325,7 +1328,9 @@ public void handlePathValue(String path, String value) {
// old format
version = parts.getAttributeValue(0, "version");
}
cldrVersionString = version;
cldrVersion = VersionInfo.getInstance(version);
unicodeVersion = parts.getAttributeValue(1, "unicodeVersion");
}
return;
}
Expand Down Expand Up @@ -4961,6 +4966,18 @@ public VersionInfo getCldrVersion() {
return cldrVersion;
}

public String getUnicodeVersionString() {
return unicodeVersion;
}

public VersionInfo getUnicodeVersion() {
return VersionInfo.getInstance(getUnicodeVersionString());
}

public String getCldrVersionString() {
return cldrVersionString;
}

public File getDirectory() {
return directory;
}
Expand Down

0 comments on commit 1340032

Please sign in to comment.