From 951ebdf243538854317edebd1b20fc757737dba6 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 31 Jul 2024 13:35:52 -0500 Subject: [PATCH 1/2] CLDR-17857 remove the LogKnownIssues for CLDR-15663 - no logKnown issue is needed, the test is already correct. - English translation will not be needed until coverageLocales.txt is updated. --- .../java/org/unicode/cldr/unittest/LikelySubtagsTest.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/LikelySubtagsTest.java b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/LikelySubtagsTest.java index 6bfa2a607ff..efc44b2acff 100644 --- a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/LikelySubtagsTest.java +++ b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/LikelySubtagsTest.java @@ -340,12 +340,7 @@ public void TestMissingInfoForLanguage() { if (englishName == null) { Level covLevel = ccl.getEffectiveCoverageLevel(language); if (covLevel == null || !covLevel.isAtLeast(Level.BASIC)) { - // https://unicode-org.atlassian.net/browse/CLDR-15663 - if (logKnownIssue( - "CLDR-15663", - "English translation should not be required for sub-basic language name")) { - continue; // skip error - } + continue; // skip error if locale is not at least basic. (null means sub-basic) } errln("Missing English translation for: " + language + " which is at " + covLevel); } From 1516aa224af6354431c6b65e9fd879e27c600c95 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 31 Jul 2024 14:03:27 -0500 Subject: [PATCH 2/2] CLDR-17857 add a whole-locale warning for missing English name. - warning, not error, otherwise we'd block builds! - new subtype missingEnglishName --- .../java/org/unicode/cldr/test/CheckCLDR.java | 3 ++- .../org/unicode/cldr/test/CheckCoverage.java | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) 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 2c8fd1540ad..96d6a049c3b 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 @@ -936,7 +936,8 @@ public enum Subtype { shortDateFieldInconsistentLength, illegalParameterValue, illegalAnnotationCode, - illegalCharacter; + illegalCharacter, + missingEnglishName; @Override public String toString() { diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckCoverage.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckCoverage.java index 0e5e8ea96da..06088e7d1e1 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckCoverage.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckCoverage.java @@ -10,6 +10,7 @@ import org.unicode.cldr.test.CheckCLDR.CheckStatus.Subtype; import org.unicode.cldr.util.CLDRFile; import org.unicode.cldr.util.CLDRFile.Status; +import org.unicode.cldr.util.CLDRLocale; import org.unicode.cldr.util.Factory; import org.unicode.cldr.util.InternalCldrException; import org.unicode.cldr.util.LanguageTagParser; @@ -157,6 +158,25 @@ public CheckCLDR handleSetCldrFileToCheck( setSkipTest(false); latin = ValuePathStatus.isLatinScriptLocale(cldrFileToCheck); + // check whether the English name is present. See {@link + // LikelySubtagsTest#TestMissingInfoForLanguage} + { + final CLDRLocale locale = CLDRLocale.getInstance(localeID); + String path = CLDRFile.getKey(CLDRFile.LANGUAGE_NAME, locale.getLanguage()); + // getEnglishFile() returns a resolved file, so just check isHere. + boolean englishName = getEnglishFile().isHere(path); + if (!englishName) { + possibleErrors.add( + new CheckStatus() + .setCause(this) + .setMainType(CheckStatus.warningType) + .setSubtype(Subtype.missingEnglishName) + .setMessage( + "Missing English translation for " + locale.getLanguage(), + new Object[] {})); + } + } + return this; }