diff --git a/tools/cldr-apps/js/src/esm/cldrSurvey.mjs b/tools/cldr-apps/js/src/esm/cldrSurvey.mjs index 48d4591d11a..2d348f10316 100644 --- a/tools/cldr-apps/js/src/esm/cldrSurvey.mjs +++ b/tools/cldr-apps/js/src/esm/cldrSurvey.mjs @@ -752,8 +752,15 @@ function testsToHtml(tests) { if (!tests) { return newHtml; } + var hadEntireLocale = false; + for (var i = 0; i < tests.length; i++) { var testItem = tests[i]; + const { entireLocale } = testItem; + if (entireLocale) { + hadEntireLocale = true; + continue; + } newHtml += "
(how to fix…)'; } - newHtml += "
"; + newHtml += "\n"; + } + if (hadEntireLocale) { + newHtml += `See also ${cldrText.get( + "special_r_supplemental" + )}
\n`; } return newHtml; } diff --git a/tools/cldr-apps/js/src/esm/cldrText.mjs b/tools/cldr-apps/js/src/esm/cldrText.mjs index e4de7986805..b27a54ebcf0 100644 --- a/tools/cldr-apps/js/src/esm/cldrText.mjs +++ b/tools/cldr-apps/js/src/esm/cldrText.mjs @@ -495,6 +495,7 @@ const strings = { special_r_datetime: "Datetime", special_r_zones: "Zones", special_r_personnames: "Person Names", + special_r_supplemental: "Entire Locale Errors", special_recent_activity: "Recent Activity", special_retry: "Retry", special_retry_inplace: "Retry", diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/SubtypeToURLMap.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/SubtypeToURLMap.java index b6ed8634989..3b3cdc41591 100644 --- a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/SubtypeToURLMap.java +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/SubtypeToURLMap.java @@ -36,13 +36,14 @@ import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.unicode.cldr.test.CheckCLDR.CheckStatus.Subtype; +import org.unicode.cldr.test.CheckCLDR.SubtypeToURLProvider; import org.unicode.cldr.util.CLDRCacheDir; import org.unicode.cldr.util.CLDRTool; @CLDRTool( alias = "subtype-to-url-map", description = "parse each of the params as a path or URL to a subtype map and check.") -public class SubtypeToURLMap { +public class SubtypeToURLMap implements SubtypeToURLProvider { static final Logger logger = SurveyLog.forClass(SubtypeToURLMap.class); /** * Little tool for validating input data. @@ -514,4 +515,9 @@ public static String forSubtype(Subtype subtype) { if (SubtypeToURLMapHelper.INSTANCE == null) return null; return SubtypeToURLMapHelper.INSTANCE.get(subtype); } + + @Override + public String apply(Subtype t) { + return forSubtype(t); + } } diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/SurveyJSONWrapper.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/SurveyJSONWrapper.java index 90d340b4ee6..31c14886316 100644 --- a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/SurveyJSONWrapper.java +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/SurveyJSONWrapper.java @@ -67,6 +67,7 @@ public static JSONObject wrap(CheckStatus status) throws JSONException { put("subtype", subtype.name()); put("subtypeUrl", SubtypeToURLMap.forSubtype(subtype)); // could be null. } + put("entireLocale", cs.getEntireLocale()); } }; } diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/ReportAPI.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/ReportAPI.java index 147d8f3d6f4..7973d09ecc0 100644 --- a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/ReportAPI.java +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/ReportAPI.java @@ -32,9 +32,11 @@ import org.unicode.cldr.util.VoterReportStatus.ReportAcceptability; import org.unicode.cldr.util.VoterReportStatus.ReportId; import org.unicode.cldr.web.CookieSession; +import org.unicode.cldr.web.DataPage; import org.unicode.cldr.web.ReportsDB; import org.unicode.cldr.web.ReportsDB.UserReport; import org.unicode.cldr.web.STFactory; +import org.unicode.cldr.web.SubtypeToURLMap; import org.unicode.cldr.web.SurveyAjax; import org.unicode.cldr.web.SurveyMain; import org.unicode.cldr.web.UserRegistry; @@ -414,10 +416,14 @@ public Response getReportOutput( private String writeReport(ReportId report, CLDRLocale loc) throws IOException { final Writer w = new StringWriter(); + final STFactory stf = CookieSession.sm.getSTFactory(); final Chart chart = Chart.forReport(report, loc.getBaseName()); if (chart != null) { - final STFactory stf = CookieSession.sm.getSTFactory(); - chart.writeContents(w, stf); + chart.writeContents( + w, + stf, + stf.getTestResult(loc, DataPage.getSimpleOptions(loc)), + SubtypeToURLMap.getInstance()); } else { switch (report) { // "Old Three" reports diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/VoteAPI.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/VoteAPI.java index 544f482d433..b0ec3882a92 100644 --- a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/VoteAPI.java +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/VoteAPI.java @@ -352,6 +352,7 @@ public static final class CheckStatusSummary { public String subtypeUrl; public Phase phase; public String cause; + public boolean entireLocale; public CheckStatusSummary(CheckStatus checkStatus) { this.message = checkStatus.getMessage(); @@ -366,6 +367,7 @@ public CheckStatusSummary(CheckStatus checkStatus) { if (this.subtype != null) { this.subtypeUrl = SubtypeToURLMap.forSubtype(this.subtype); // could be null. } + this.entireLocale = checkStatus.getEntireLocale(); } } } diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckCLDR.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckCLDR.java index 18588668af8..d5caed38a89 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckCLDR.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckCLDR.java @@ -26,6 +26,7 @@ import java.util.Map; import java.util.Set; import java.util.TreeSet; +import java.util.function.Function; import java.util.logging.Logger; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -786,6 +787,12 @@ protected boolean accept(ListThis chart shows errors which apply to the entire locale.
"; + } + + @Override + public String getFileName() { + return locale; + } + + @Override + public void writeContents( + Writer pw, Factory factory, TestResultBundle test, SubtypeToURLProvider urlProvider) + throws IOException { + CLDRFile cldrFile = factory.make(locale, true); + + if (test != null) { + Set" + s.getMessage() + "
"); + if (urlProvider != null) { + final String moreDetailsUrl = urlProvider.apply(s.getSubtype()); + pw.write(String.format("more details", moreDetailsUrl)); + } + pw.write("