Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLDR-17857 add whole-locale warning for missing English name #3924

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,8 @@ public enum Subtype {
shortDateFieldInconsistentLength,
illegalParameterValue,
illegalAnnotationCode,
illegalCharacter;
illegalCharacter,
missingEnglishName;

@Override
public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,12 +340,7 @@
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);
}
Expand Down Expand Up @@ -547,7 +542,7 @@
}

if (!collectedBad.isEmpty()) {
warnln(

Check warning on line 545 in tools/cldr-code/src/test/java/org/unicode/cldr/unittest/LikelySubtagsTest.java

View workflow job for this annotation

GitHub Actions / build

(LikelySubtagsTest.java:545) Warning: Locales have 214 unexpected characters in main and/or aux: [҂״܀-܍०-९৲-৺੦-੯૰౦-౯໐-໙၀-၉၏႐-႙႞႟፠-፼᎐-᎙᠐-᠙꒐-꓆𞅏{a\:}{ch’}{e\:}{i\:}{k’}{o\:}{ts’}{tł’}{t’}{à\:}{á\:}{è\:}{é\:}{ì\:}{í\:}{ò\:}{ó\:}{ଅ\:}{ଆ\:}{ଏ\:}]
"Locales have "
+ collectedBad.size()
+ " unexpected characters in main and/or aux:\t"
Expand Down Expand Up @@ -781,7 +776,7 @@
// SUPPLEMENTAL_DATA_INFO.getLikelyOrigins().get(value);
// fieldToOrigin.put(value, origin == null ? "n/a" : origin);
// }
warnln("Bad status=" + entry.getKey() + " for " + entry.getValue());

Check warning on line 779 in tools/cldr-code/src/test/java/org/unicode/cldr/unittest/LikelySubtagsTest.java

View workflow job for this annotation

GitHub Actions / build

(LikelySubtagsTest.java:779) Warning: Bad status=macroregion for [001, 419]
}
}
}
Expand Down
Loading