Skip to content

Commit

Permalink
CLDR-18277 json: update PACKAGES.md (#4338)
Browse files Browse the repository at this point in the history
  • Loading branch information
srl295 authored Feb 11, 2025
1 parent c01b350 commit 74465b7
Showing 1 changed file with 21 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ enum RunType {
annotationsDerived,
bcp47(false, false),
transforms(false, false),
subdivisions(false, true);
subdivisions(true, true);

private final boolean isTiered;
private final boolean hasLocales;
Expand Down Expand Up @@ -1707,7 +1707,9 @@ public void writePackageList(String outputDir) throws IOException {
+ "cldr-packages.json and PACKAGES.md");
PrintWriter pkgs = FileUtilities.openUTF8Writer(outputDir + "/..", "PACKAGES.md");

pkgs.println("# CLDR JSON Packages");
pkgs.println("# CLDR-JSON Package List");
pkgs.println();
pkgs.println("## Packages");
pkgs.println();

LdmlConfigFileReader uberReader = new LdmlConfigFileReader();
Expand All @@ -1730,7 +1732,20 @@ public void writePackageList(String outputDir) throws IOException {
final String baseName = e.getKey();

if (baseName.equals("IGNORE") || baseName.equals("cal")) continue;
if (baseName.equals("core") || baseName.equals("rbnf") || baseName.equals("bcp47")) {

boolean tiered = !baseName.equals("core");
// If it's a known un-tiered enum type, skip tiered.
try {
RunType r = RunType.valueOf(baseName);
if (!r.tiered()) {
tiered = false;
}
} catch (IllegalArgumentException t) {
// ignored
}

// if not tiered
if (!tiered) {
JsonObject packageEntry = new JsonObject();
packageEntry.addProperty("description", e.getValue());
packageEntry.addProperty("name", CLDR_PKG_PREFIX + baseName);
Expand Down Expand Up @@ -1762,16 +1777,16 @@ public void writePackageList(String outputDir) throws IOException {
}
}
}
pkgs.println();

for (Map.Entry<String, String> e : pkgsToDesc.entrySet()) {
pkgs.println("### [" + e.getKey() + "](./cldr-json/" + e.getKey() + "/)");
pkgs.println();
if (e.getKey().contains("-modern")) {
pkgs.println(
" - **Note: Deprecated** see [CLDR-16465](https://unicode-org.atlassian.net/browse/CLDR-16465).");
}
pkgs.println(" - " + e.getValue());
pkgs.println(" - " + getNpmBadge(e.getKey()));
pkgs.println("- " + e.getValue());
pkgs.println("- " + getNpmBadge(e.getKey()));
pkgs.println();
}
obj.add("packages", packages);
Expand Down

0 comments on commit 74465b7

Please sign in to comment.