Skip to content

Commit

Permalink
CLDR-9774 Enable test for missing/extra English names for BCP47 keys/…
Browse files Browse the repository at this point in the history
…types
  • Loading branch information
pedberg-icu committed Feb 12, 2025
1 parent 74465b7 commit 22decaf
Showing 1 changed file with 16 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ public static void main(String[] args) {
}

public void TestEnglishKeyTranslations() {
logKnownIssue(
"cldr7631",
"Using just warnings for now, until issues are resolved. Change WARNING/ERROR when removing this.");
ChainedMap.M3<String, String, String> foundEnglish =
ChainedMap.of(
new TreeMap<String, Object>(), new TreeMap<String, Object>(), String.class);
Expand All @@ -103,14 +100,11 @@ public void TestEnglishKeyTranslations() {
if (keyTrans != null) {
engKey = keyAlias;
foundEnglish.put(engKey, "", keyTrans);
msg(
warnln(

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

View workflow job for this annotation

GitHub Actions / build

(TestBCP47.java:103) Warning: Type for English 'key' translation is calendar, while bcp47 is ca

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

View workflow job for this annotation

GitHub Actions / build

(TestBCP47.java:103) Warning: Type for English 'key' translation is collation, while bcp47 is co
"Type for English 'key' translation is "
+ engKey
+ ", while bcp47 is "
+ bcp47Key,
WARNING,
true,
true);
+ bcp47Key);
break;
}
}
Expand All @@ -125,17 +119,14 @@ public void TestEnglishKeyTranslations() {
Collections.<String>emptySet(),
keyTrans));
} else {
msg(
errln(
showData(
bcp47Key,
"",
SUPPLEMENTAL_DATA_INFO.getBcp47Descriptions().get(keyRow),
keyAliases,
Collections.<String>emptySet(),
"MISSING"),
ERROR,
true,
true);
"MISSING"));
}
if (bcp47Key.equals("tz")) {
continue;
Expand All @@ -156,32 +147,29 @@ public void TestEnglishKeyTranslations() {
final String type = extra.get1();
final String trans = extra.get2();
if (foundEnglish.get(key, type) == null) {
if (key.equals("x")) {
msg(
if (key.equals("x") || key.equals("t")) {
logln(
"OK Extra English: "
+ showData(
key,
type,
"MISSING",
Collections.<String>emptySet(),
Collections.<String>emptySet(),
trans),
LOG,
true,
true);
trans));
} else if (type.equals("big5han") || type.equals("gb2312han")) {
logKnownIssue(
"CLDR-18307", "Remove English names for deprecated collation types");
} else {
msg(
errln(
"*Extra English: "
+ showData(
key,
type,
"MISSING",
Collections.<String>emptySet(),
Collections.<String>emptySet(),
trans),
ERROR,
true,
true);
trans));
}
}
}
Expand Down Expand Up @@ -223,18 +211,15 @@ private void checkKeyType(
if (trans != null) {
engType = typeAlias;
foundEnglish.put(engKey, engType, trans);
msg(
warnln(

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

View workflow job for this annotation

GitHub Actions / build

(TestBCP47.java:214) Warning: Type for English 'key+type' translation is calendar+ethiopic-amete-alem, while bcp47 is ca+ethioaa

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

View workflow job for this annotation

GitHub Actions / build

(TestBCP47.java:214) Warning: Type for English 'key+type' translation is calendar+gregorian, while bcp47 is ca+gregory

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

View workflow job for this annotation

GitHub Actions / build

(TestBCP47.java:214) Warning: Type for English 'key+type' translation is collation+dictionary, while bcp47 is co+dict
"Type for English 'key+type' translation is "
+ engKey
+ "+"
+ engType
+ ", while bcp47 is "
+ bcp47Key
+ "+"
+ bcp47Type,
WARNING,
true,
true);
+ bcp47Type);
break;
}
}
Expand All @@ -260,17 +245,14 @@ private void checkKeyType(
typeAliases,
trans));
} else {
msg(
errln(
showData(
bcp47Key,
bcp47Type,
SUPPLEMENTAL_DATA_INFO.getBcp47Descriptions().get(row),
keyAliases,
typeAliases,
"MISSING"),
ERROR,
true,
true);
"MISSING"));
}
}

Expand Down

0 comments on commit 22decaf

Please sign in to comment.