-
Notifications
You must be signed in to change notification settings - Fork 388
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-17600 BRS 7 Update language names #3666
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -798,7 +798,7 @@ | |
continue; | ||
} | ||
|
||
errln("Comprehensive & no exception for path =>\t" + path); | ||
Check failure on line 801 in tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCoverageLevel.java GitHub Actions / build
Check failure on line 801 in tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCoverageLevel.java GitHub Actions / build
Check failure on line 801 in tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCoverageLevel.java GitHub Actions / build
Check failure on line 801 in tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCoverageLevel.java GitHub Actions / build
Check failure on line 801 in tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCoverageLevel.java GitHub Actions / build
Check failure on line 801 in tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCoverageLevel.java GitHub Actions / build
Check failure on line 801 in tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCoverageLevel.java GitHub Actions / build
Check failure on line 801 in tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCoverageLevel.java GitHub Actions / build
Check failure on line 801 in tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCoverageLevel.java GitHub Actions / build
|
||
} | ||
} | ||
|
||
|
@@ -1173,6 +1173,7 @@ | |
|
||
// get CLDR locale IDs' codes | ||
|
||
// the maps are from codes (like en) to the best level in the CLDR Organization. | ||
Map<String, Level> langs = new TreeMap<>(); | ||
Map<String, Level> scripts = new TreeMap<>(); | ||
Map<String, Level> regions = new TreeMap<>(); | ||
|
@@ -1197,6 +1198,15 @@ | |
|
||
Map<String, CoverageStatus> data = new TreeMap<>(); | ||
|
||
// This is a map from integers (representing language, script or region; should rewrite to | ||
// use enums) | ||
// to a row of data: | ||
// name, | ||
// map code => best cldr org level, | ||
// codes in root | ||
// expected coverage levels levels | ||
// should change the row of data into a class; would be much easier to understand | ||
|
||
ImmutableMap<Integer, R4<String, Map<String, Level>, Set<String>, Level>> typeToInfo = | ||
ImmutableMap.of( | ||
CLDRFile.LANGUAGE_NAME, | ||
|
@@ -1210,15 +1220,24 @@ | |
typeToInfo.entrySet()) { | ||
int type = typeAndInfo.getKey(); | ||
String name = typeAndInfo.getValue().get0(); | ||
Map<String, Level> idPartMap = typeAndInfo.getValue().get1(); | ||
Set<String> setRoot = typeAndInfo.getValue().get2(); | ||
Level targetLevel = typeAndInfo.getValue().get3(); | ||
Map<String, Level> idPartMap = | ||
typeAndInfo.getValue().get1(); // map from code to best cldr level | ||
Set<String> setRoot = typeAndInfo.getValue().get2(); // set of codes in root | ||
Level targetLevel = | ||
typeAndInfo.getValue().get3(); // it looks like the targetLevel is ignored | ||
|
||
for (String code : Sets.union(idPartMap.keySet(), setRoot)) { | ||
String displayName = testInfo.getEnglish().getName(type, code); | ||
String path = CLDRFile.getKey(type, code); | ||
Level level = coverageLevel.getLevel(path); | ||
data.put( | ||
name + "\t" + code, | ||
|
||
// Level level; | ||
// boolean inRoot; | ||
// boolean inId; | ||
// Level languageLevel; best in cldr org | ||
// String displayName; | ||
new CoverageStatus( | ||
level, | ||
setRoot.contains(code), | ||
|
@@ -1263,6 +1282,7 @@ | |
} | ||
} | ||
|
||
// just check languages | ||
Set<String> ids = new TreeSet<>(); | ||
Set<String> missing = new TreeSet<>(); | ||
for (Entry<String, CoverageStatus> entry : data.entrySet()) { | ||
|
@@ -1272,15 +1292,15 @@ | |
} | ||
final CoverageStatus value = entry.getValue(); | ||
if (value.inId) { | ||
String[] parts = key.split("\t"); | ||
String[] parts = key.split("\t"); // split into language and code | ||
ids.add(parts[1]); | ||
if (!value.inRoot) { | ||
missing.add(parts[1]); | ||
} | ||
} | ||
} | ||
if (!assertEquals( | ||
"Language subtags that are in a CLDR locale's ID are in root (" | ||
"Language subtags in a locale's ID must be in one of the attributeValueValidity.xml $language* sets, typically $languageNonTcLtBasic (" | ||
+ missing.size() | ||
+ ")", | ||
"", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there also a test that warns if a locale is being removed from a TC org's language set that it needs to be changed to be in the non-TC org Basic or higher list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There isn't, and that's reasonable. But I'd like that to be a separate ticket, since we don't have to do it this release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, SGTM!