diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/Chart.java b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/Chart.java
index 697d1e24dd6..7c6c786905b 100644
--- a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/Chart.java
+++ b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/Chart.java
@@ -38,7 +38,7 @@ public abstract class Chart {
public static final String CHART_VERSION_DIRECTORY =
ToolConstants.getBaseDirectory(ToolConstants.CHART_VERSION);
- public static final String GITHUB_ROOT = CLDRURLS.CLDR_REPO_ROOT + "/blob/main/";
+ public static final String GITHUB_ROOT = CLDRURLS.CLDR_REPO_MAIN;
public static final String LDML_SPEC = "https://unicode.org/reports/tr35/";
public static String dataScrapeMessage(String specPart, String testFile, String... dataFiles) {
diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/GenerateTransformCharts.java b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/GenerateTransformCharts.java
index c5691638fca..a30d01372c9 100644
--- a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/GenerateTransformCharts.java
+++ b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/GenerateTransformCharts.java
@@ -36,6 +36,7 @@
import org.unicode.cldr.util.CLDRPaths;
import org.unicode.cldr.util.CLDRTransforms;
import org.unicode.cldr.util.CLDRTransforms.ParsedTransformID;
+import org.unicode.cldr.util.CLDRURLS;
import org.unicode.cldr.util.CldrUtility;
import org.unicode.cldr.util.FileCopier;
import org.unicode.cldr.util.Pair;
@@ -367,7 +368,9 @@ private static void showAllLatin() throws IOException {
+ "These charts do not show the available script and language transliterations that are not to/from Latin. "
+ "It also does not show other transforms that are available in CLDR, such as the casing transformations, "
+ "full-width and half-width transformations, and specialized transformations such as IPA-XSampa. "
- + "For the latest snapshot of the data files, see Transform XML Data. "
+ + "For the latest snapshot of the data files, see Transform XML Data. "
+ "For more information, see below.");
index.flush();
index.println("
");
diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/ShowLanguages.java b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/ShowLanguages.java
index 8433d9e72b1..3f0155fc307 100644
--- a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/ShowLanguages.java
+++ b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/ShowLanguages.java
@@ -8,9 +8,9 @@
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Multimap;
import com.google.common.collect.Multimaps;
+import com.google.common.collect.Sets;
import com.google.common.collect.TreeMultimap;
import com.ibm.icu.impl.Relation;
import com.ibm.icu.impl.Row.R2;
@@ -1362,7 +1362,7 @@ private String getLanguagePluralMessage(String msg, String languageCode) {
}
private String getLanguageName(String languageCode) {
- String result = english.getName(languageCode);
+ String result = english.getName(languageCode, true, CLDRFile.SHORT_ALTS);
if (!result.equals(languageCode)) return result;
Set names = Iso639Data.getNames(languageCode);
if (names != null && names.size() != 0) {
@@ -1372,171 +1372,189 @@ private String getLanguageName(String languageCode) {
}
static final Set TC_Vendors =
- ImmutableSet.of(
- Organization.apple,
- Organization.google,
- Organization.microsoft,
- Organization.cldr);
+ Sets.union(
+ Organization.getTCOrgs(),
+ // This adds the CLDR org at the end of the list
+ Set.of(Organization.cldr));
private void showCoverageGoals(PrintWriter pw) throws IOException {
- PrintWriter pw2 =
- new PrintWriter(
- new FormattedFileWriter(
- null,
- "Coverage Goals",
- null
- // "" +
- // "The following show default coverage goals for larger
- // organizations. " +
- // "[n/a] shows where there is no specific value for a
- // given organization, " +
- // "while (...) indicates that the goal is inherited from
- // the parent. " +
- // "A * is added if the goal differs from the parent locale's
- // goal. " +
- // "For information on what these goals mean (comprehensive,
- // modern, moderate,...), see the LDML specification "
- // +
- // "Appendix M: Coverage Levels. " +
- // +
- // "
"
- ,
- null));
-
- TablePrinter tablePrinter =
- new TablePrinter()
- // tablePrinter.setSortPriorities(0,4)
- .addColumn("Language", "class='source'", null, "class='source'", false)
- .setSortPriority(0)
- .setBreakSpans(false)
+ try (PrintWriter pw2 =
+ new PrintWriter(
+ new FormattedFileWriter(
+ null,
+ "Coverage Goals",
+ null,
+ SUPPLEMENTAL_INDEX_ANCHORS));
+ PrintWriter coverageGoalsTsv =
+ FileUtilities.openUTF8Writer(
+ CLDRPaths.CHART_DIRECTORY + "tsv/", "coverage_goals.tsv"); ) {
+
+ TablePrinter tablePrinter =
+ new TablePrinter()
+ // tablePrinter.setSortPriorities(0,4)
+ .addColumn(
+ "Language", "class='source'", null, "class='source'", false)
+ .setSortPriority(0)
+ .setBreakSpans(false)
+ .addColumn(
+ "Code",
+ "class='source'",
+ "{0}",
+ "class='source'",
+ false)
+ .addColumn(
+ "D. Votes",
+ "class='target'",
+ null,
+ "class='target'",
+ false);
+
+ Map> vendordata = sc.getLocaleTypes();
+ Set locales = new TreeSet<>();
+ Set vendors = new LinkedHashSet<>();
+ Set smallVendors = new LinkedHashSet<>();
+
+ for (Organization organization : TC_Vendors) {
+ // if (vendor.equals(Organization.java)) continue;
+ Map data = vendordata.get(organization);
+ vendors.add(organization);
+ tablePrinter
.addColumn(
- "Code",
- "class='source'",
- "{0}",
- "class='source'",
+ organization.getDisplayName(),
+ "class='target'",
+ null,
+ "class='target'",
false)
- .addColumn("D. Votes", "class='target'", null, "class='target'", false);
+ .setSpanRows(false);
+ locales.addAll(data.keySet());
+ showTabbedOrgLevels(coverageGoalsTsv, organization, data);
+ }
- Map> vendordata = sc.getLocaleTypes();
- Set locales = new TreeSet<>();
- Set vendors = new LinkedHashSet<>();
- Set smallVendors = new LinkedHashSet<>();
+ for (Entry> vendorData : vendordata.entrySet()) {
+ Organization organization = vendorData.getKey();
+ if (!TC_Vendors.contains(organization)) {
+ smallVendors.add(organization);
+ Map data = vendordata.get(organization);
+ showTabbedOrgLevels(coverageGoalsTsv, organization, data);
+ continue;
+ }
+ }
- for (Organization organization : TC_Vendors) {
- // if (vendor.equals(Organization.java)) continue;
- Map data = vendordata.get(organization);
- vendors.add(organization);
- tablePrinter
- .addColumn(
- organization.getDisplayName(),
- "class='target'",
- null,
- "class='target'",
- false)
- .setSpanRows(false);
- locales.addAll(data.keySet());
- }
+ Collection data = new ArrayList<>();
+ List list = new ArrayList<>();
+ LanguageTagParser ltp = new LanguageTagParser();
+ // String alias2 = getAlias("sh_YU");
- for (Entry> vendorData : vendordata.entrySet()) {
- Organization vendor = vendorData.getKey();
- if (!TC_Vendors.contains(vendor)) {
- smallVendors.add(vendor);
- continue;
- }
- }
+ pw2.append("TC Orgs
");
- Collection data = new ArrayList<>();
- List list = new ArrayList<>();
- LanguageTagParser ltp = new LanguageTagParser();
- // String alias2 = getAlias("sh_YU");
-
- pw2.append("TC Orgs
");
-
- for (String locale : locales) {
- list.clear();
- String localeCode = locale.equals("*") ? "und" : locale;
- String alias = getAlias(localeCode);
- if (!alias.equals(localeCode)) {
- throw new IllegalArgumentException(
- "Should use canonical form: " + locale + " => " + alias);
- }
- String baseLang = ltp.set(localeCode).getLanguage();
- String baseLangName = getLanguageName(baseLang);
- list.add("und".equals(localeCode) ? "other" : baseLangName);
- list.add(locale);
- int defaultVotes =
- supplementalDataInfo.getRequiredVotes(CLDRLocale.getInstance(locale), null);
- list.add(String.valueOf(defaultVotes));
- for (Organization vendor : vendors) {
- String status = getVendorStatus(locale, vendor, vendordata);
- // if (!baseLang.equals(locale) && !status.startsWith("<")) {
- // String langStatus = getVendorStatus(baseLang, vendor,
- // vendordata);
- // if (!langStatus.equals(status)) {
- // status += "*";
- // }
- // }
- list.add(status);
+ for (String locale : locales) {
+ list.clear();
+ String localeCode = locale.equals("*") ? "und" : locale;
+ String alias = getAlias(localeCode);
+ if (!alias.equals(localeCode)) {
+ throw new IllegalArgumentException(
+ "Should use canonical form: " + locale + " => " + alias);
+ }
+ // String baseLang = ltp.set(localeCode).getLanguage();
+ String baseLangName = getLanguageName(localeCode);
+ list.add("und".equals(localeCode) ? "other" : baseLangName);
+ list.add(locale);
+ int defaultVotes =
+ supplementalDataInfo.getRequiredVotes(
+ CLDRLocale.getInstance(locale), null);
+ list.add(String.valueOf(defaultVotes));
+ for (Organization vendor : vendors) {
+ String status = getVendorStatus(locale, vendor, vendordata);
+ // if (!baseLang.equals(locale) &&
+ // !status.startsWith("<")) {
+ // String langStatus = getVendorStatus(baseLang,
+ // vendor,
+ // vendordata);
+ // if (!langStatus.equals(status)) {
+ // status += "*";
+ // }
+ // }
+ list.add(status);
+ }
+ data.add(list.toArray(new String[list.size()]));
}
- data.add(list.toArray(new String[list.size()]));
- }
- Comparable[][] flattened = data.toArray(new Comparable[data.size()][]);
- String value = tablePrinter.addRows(flattened).toTable();
- pw2.println(value);
-
- pw2.append("Others
");
-
- for (Organization vendor2 : smallVendors) {
- pw2.append("- ");
- pw2.append(TransliteratorUtilities.toHTML.transform(vendor2.getDisplayName()))
- .append(": ");
- boolean first1 = true;
- for (Level level : Level.values()) {
- boolean first2 = true;
- Level other = null;
- for (Entry data2 : vendordata.get(vendor2).entrySet()) {
- String key = data2.getKey();
- Level level2 = data2.getValue();
- if (level != level2) {
- continue;
- }
- if (key.equals("*")) {
- other = level2;
- continue;
- }
- if (first2) {
- if (first1) {
- first1 = false;
+ Comparable[][] flattened = data.toArray(new Comparable[data.size()][]);
+ String value = tablePrinter.addRows(flattened).toTable();
+ pw2.println(value);
+
+ pw2.append("
Others
");
+
+ for (Organization vendor2 : smallVendors) {
+ pw2.append("- ");
+ pw2.append(TransliteratorUtilities.toHTML.transform(vendor2.getDisplayName()))
+ .append(": ");
+ boolean first1 = true;
+ for (Level level : Level.values()) {
+ boolean first2 = true;
+ Level other = null;
+ for (Entry data2 : vendordata.get(vendor2).entrySet()) {
+ String key = data2.getKey();
+ Level level2 = data2.getValue();
+ if (level != level2) {
+ continue;
+ }
+ if (key.equals("*")) {
+ other = level2;
+ continue;
+ }
+ if (first2) {
+ if (first1) {
+ first1 = false;
+ } else {
+ pw2.append("; ");
+ }
+ pw2.append(level2.toString()).append(": ");
+ first2 = false;
} else {
- pw2.append("; ");
+ pw2.append(", ");
}
- pw2.append(level2.toString()).append(": ");
- first2 = false;
- } else {
- pw2.append(", ");
+ pw2.append(TransliteratorUtilities.toHTML.transform(key));
}
- pw2.append(TransliteratorUtilities.toHTML.transform(key));
- }
- if (other != null) {
- if (first2) {
- if (first1) {
- first1 = false;
+ if (other != null) {
+ if (first2) {
+ if (first1) {
+ first1 = false;
+ } else {
+ pw2.append("; ");
+ }
+ pw2.append(level.toString()).append(": ");
+ first2 = false;
} else {
- pw2.append("; ");
+ pw2.append(", ");
}
- pw2.append(level.toString()).append(": ");
- first2 = false;
- } else {
- pw2.append(", ");
+ pw2.append("other");
}
- pw2.append("other");
}
+ pw2.append("
");
}
- pw2.append("");
+ pw2.append("
");
+ }
+ }
+
+ public void showTabbedOrgLevels(
+ PrintWriter coverageGoalsTsv, Organization organization, Map data) {
+ coverageGoalsTsv.println(
+ String.format(
+ "\n#%s\t;\t%s\t;\t%s\t;\t%s\n",
+ "Org", "Locale", "Level", "Locale Name"));
+ for (Entry entry : data.entrySet()) {
+ String locale = entry.getKey();
+ Level level = entry.getValue();
+ final String name =
+ locale.equals("*")
+ ? "ALL"
+ : english.getName(locale, true, CLDRFile.SHORT_ALTS);
+ coverageGoalsTsv.println(
+ String.format(
+ "%s\t;\t%s\t;\t%s\t;\t%s", organization, locale, level, name));
}
- pw2.append("
");
- pw2.close();
}
LanguageTagParser lpt2 = new LanguageTagParser();
diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/ShowLocaleCoverage.java b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/ShowLocaleCoverage.java
index 01c700eadf5..946a06fd10c 100644
--- a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/ShowLocaleCoverage.java
+++ b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/ShowLocaleCoverage.java
@@ -40,6 +40,7 @@
import org.unicode.cldr.util.CLDRFile.DraftStatus;
import org.unicode.cldr.util.CLDRLocale;
import org.unicode.cldr.util.CLDRPaths;
+import org.unicode.cldr.util.CLDRURLS;
import org.unicode.cldr.util.CldrUtility;
import org.unicode.cldr.util.CoreCoverageInfo;
import org.unicode.cldr.util.CoreCoverageInfo.CoreItems;
@@ -67,7 +68,8 @@
public class ShowLocaleCoverage {
private static final String TSV_BASE =
- "https://github.com/unicode-org/cldr-staging/blob/main/docs/charts/"
+ CLDRURLS.CLDR_STAGING_REPO_MAIN
+ + "docs/charts/"
+ ToolConstants.CHART_VI.getVersionString(1, 2)
+ "/tsv/";
public static final Splitter LF_SPLITTER = Splitter.on('\n');
@@ -887,7 +889,7 @@ private static void showCoverage(
tablePrinter
.addRow()
.addCell(language)
- .addCell(ENGLISH.getName(language))
+ .addCell(ENGLISH.getName(language, true, CLDRFile.SHORT_ALTS))
.addCell(file.getName(language))
.addCell(script)
.addCell(defRegion)
diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRURLS.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRURLS.java
index be875502384..78a3dc24e45 100644
--- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRURLS.java
+++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRURLS.java
@@ -10,9 +10,13 @@ public abstract class CLDRURLS {
public static final String CLDR_SCHEMA_BASE = "https://schemas.unicode.org/cldr";
public static final String CLDR_CURVER_BASE = CLDR_SCHEMA_BASE + "/" + CLDRFile.GEN_VERSION;
/** Base URL for the CLDR repository */
- public static final String CLDR_REPO_BASE = "https://github.com/unicode-org/cldr";
+ public static final String CLDR_REPO_BASE = "https://github.com/unicode-org/cldr/";
- public static final String DEFAULT_COMMIT_BASE = CLDR_REPO_BASE + "/commit/";
+ public static final String CLDR_REPO_MAIN = CLDR_REPO_BASE + "blob/main/";
+ public static final String CLDR_STAGING_REPO_MAIN =
+ "https://github.com/unicode-org/cldr-staging/blob/main/";
+
+ public static final String DEFAULT_COMMIT_BASE = CLDR_REPO_BASE + "commit/";
/** Hostname for the Survey Tool */
public static final String DEFAULT_HOST = "st.unicode.org";