From f846a3c8e19846f4fd64a4e4a57bd8260dfa13b4 Mon Sep 17 00:00:00 2001 From: btangmu Date: Fri, 20 Dec 2024 20:17:01 -0800 Subject: [PATCH 1/6] CLDR-17014 No code fallbacks for language paths -Use the extra-paths mechanism instead of code-fallback for language paths --- .../java/org/unicode/cldr/util/CLDRFile.java | 40 +++++++++++++++++++ .../java/org/unicode/cldr/util/XMLSource.java | 31 +------------- 2 files changed, 41 insertions(+), 30 deletions(-) diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRFile.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRFile.java index b0f8107cfa8..ba17e77bd46 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRFile.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRFile.java @@ -3148,6 +3148,10 @@ public Set getRawExtraPaths() { private List getRawExtraPathsPrivate() { Set toAddTo = new HashSet<>(); SupplementalDataInfo supplementalData = CLDRConfig.getInstance().getSupplementalDataInfo(); + + // languages + getLanguageExtraPaths(toAddTo); + // units PluralInfo plurals = supplementalData.getPlurals(PluralType.cardinal, getLocaleID()); if (plurals == null && DEBUG) { @@ -3339,6 +3343,42 @@ private List getRawExtraPathsPrivate() { return toAddTo.stream().map(String::intern).collect(Collectors.toList()); } + private void getLanguageExtraPaths(Set toAddTo) { + Set codes = + StandardCodes.make().getSurveyToolDisplayCodes(NameType.LANGUAGE.getNameName()); + codes.remove(XMLSource.ROOT_ID); + String[] extraCodes = { + "ar_001", "de_AT", "de_CH", "en_AU", "en_CA", "en_GB", "en_US", "es_419", "es_ES", + "es_MX", "fa_AF", "fr_CA", "fr_CH", "frc", "hi_Latn", "lou", "nds_NL", "nl_BE", + "pt_BR", "pt_PT", "ro_MD", "sw_CD", "zh_Hans", "zh_Hant" + }; + codes.addAll(List.of(extraCodes)); + for (Iterator codeIt = codes.iterator(); codeIt.hasNext(); ) { + String code = codeIt.next(); + String fullpath = NameType.LANGUAGE.getKeyPath(code); + toAddTo.add(fullpath); + } + toAddTo.add(languageAltPath("en_GB", "short")); + toAddTo.add(languageAltPath("en_US", "short")); + toAddTo.add(languageAltPath("az", "short")); + toAddTo.add(languageAltPath("ckb", "menu")); + toAddTo.add(languageAltPath("ckb", "variant")); + toAddTo.add(languageAltPath("hi_Latn", "variant")); + toAddTo.add(languageAltPath("yue", "menu")); + toAddTo.add(languageAltPath("zh", "menu")); + toAddTo.add(languageAltPath("zh_Hans", "long")); + toAddTo.add(languageAltPath("zh_Hant", "long")); + } + + private String languageAltPath(String code, String alt) { + String fullpath = NameType.LANGUAGE.getKeyPath(code); + // Insert the @alt= string after the last occurrence of "]" + StringBuffer fullpathBuf = new StringBuffer(fullpath); + return fullpathBuf + .insert(fullpathBuf.lastIndexOf("]") + 1, "[@alt=\"" + alt + "\"]") + .toString(); + } + private void addPluralCounts( Collection toAddTo, final Set pluralCounts, diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/XMLSource.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/XMLSource.java index 8d9ccd01417..b9867355bba 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/XMLSource.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/XMLSource.java @@ -1604,7 +1604,6 @@ public String getLocaleID() { Map zone_countries = sc.getZoneToCountry(); List nameTypeList = List.of( - NameType.LANGUAGE, NameType.SCRIPT, NameType.TERRITORY, NameType.VARIANT, @@ -1628,36 +1627,10 @@ public String getLocaleID() { if (s != null && s.size() == 1) continue; } value = TimezoneFormatter.getFallbackName(value); - } else if (nameType == NameType.LANGUAGE) { - if (ROOT_ID.equals(value)) { - continue; - } } addFallbackCode(nameType, code, value); } } - - String[] extraCodes = { - "ar_001", "de_AT", "de_CH", "en_AU", "en_CA", "en_GB", "en_US", "es_419", "es_ES", - "es_MX", "fa_AF", "fr_CA", "fr_CH", "frc", "hi_Latn", "lou", "nds_NL", "nl_BE", - "pt_BR", "pt_PT", "ro_MD", "sw_CD", "zh_Hans", "zh_Hant" - }; - for (String extraCode : extraCodes) { - addFallbackCode(NameType.LANGUAGE, extraCode, extraCode); - } - - addFallbackCode(NameType.LANGUAGE, "en_GB", "en_GB", "short"); - addFallbackCode(NameType.LANGUAGE, "en_US", "en_US", "short"); - addFallbackCode(NameType.LANGUAGE, "az", "az", "short"); - - addFallbackCode(NameType.LANGUAGE, "ckb", "ckb", "menu"); - addFallbackCode(NameType.LANGUAGE, "ckb", "ckb", "variant"); - addFallbackCode(NameType.LANGUAGE, "hi_Latn", "hi_Latn", "variant"); - addFallbackCode(NameType.LANGUAGE, "yue", "yue", "menu"); - addFallbackCode(NameType.LANGUAGE, "zh", "zh", "menu"); - addFallbackCode(NameType.LANGUAGE, "zh_Hans", "zh", "long"); - addFallbackCode(NameType.LANGUAGE, "zh_Hant", "zh", "long"); - addFallbackCode(NameType.SCRIPT, "Hans", "Hans", "stand-alone"); addFallbackCode(NameType.SCRIPT, "Hant", "Hant", "stand-alone"); @@ -1742,9 +1715,7 @@ private static void addFallbackCode( NameType nameType, String code, String value, String alt) { String fullpath = nameType.getKeyPath(code); String distinguishingPath = addFallbackCodeToConstructedItems(fullpath, value, alt); - if (nameType == NameType.LANGUAGE - || nameType == NameType.SCRIPT - || nameType == NameType.TERRITORY) { + if (nameType == NameType.SCRIPT || nameType == NameType.TERRITORY) { allowDuplicates.put(distinguishingPath, code); } } From 7efc8d87ebbce3f4cf08a0d758d86c5764f143eb Mon Sep 17 00:00:00 2001 From: btangmu Date: Sun, 22 Dec 2024 09:26:13 -0800 Subject: [PATCH 2/6] CLDR-17014 Revise some tests so they pass -Change es-419 to es (419) in localeDisplayName.txt so TestLocaleDisplay passes -Add language path in testExtraPaths so it passes -Remove XMLSource.CODE_FALLBACK_ID, GERMAN, from testGetPaths so it passes --- common/testData/localeIdentifiers/localeDisplayName.txt | 2 +- .../src/test/java/org/unicode/cldr/unittest/TestCLDRFile.java | 2 ++ .../src/test/java/org/unicode/cldr/util/TestCLDRFile.java | 2 -- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/testData/localeIdentifiers/localeDisplayName.txt b/common/testData/localeIdentifiers/localeDisplayName.txt index 39e14107e8f..56b6fe55e60 100644 --- a/common/testData/localeIdentifiers/localeDisplayName.txt +++ b/common/testData/localeIdentifiers/localeDisplayName.txt @@ -2368,7 +2368,7 @@ zh-Hans-fonipa; zh (Hans, FONIPA) en-MM; en (MM) es; es -es-419; es_419 +es-419; es (419) es-Cyrl-MX; es (Cyrl, MX) hi-Latn; hi (Latn) nl-BE; nl (BE) diff --git a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCLDRFile.java b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCLDRFile.java index 6f20a37e752..b4c754373d1 100644 --- a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCLDRFile.java +++ b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCLDRFile.java @@ -190,6 +190,8 @@ public void testExtraPaths() { path.contains("/metazone") || path.contains("/timeZoneNames") || path.contains("/gender") + || path.startsWith( + "//ldml/localeDisplayNames/languages/language") || path.startsWith("//ldml/numbers/currencies/currency") || path.startsWith("//ldml/personNames/sampleName") || path.contains("/availableFormats") diff --git a/tools/cldr-code/src/test/java/org/unicode/cldr/util/TestCLDRFile.java b/tools/cldr-code/src/test/java/org/unicode/cldr/util/TestCLDRFile.java index 07519f00322..961ac1e36a7 100644 --- a/tools/cldr-code/src/test/java/org/unicode/cldr/util/TestCLDRFile.java +++ b/tools/cldr-code/src/test/java/org/unicode/cldr/util/TestCLDRFile.java @@ -270,8 +270,6 @@ public void testGetPaths() { List pwf = f.getPathsWhereFound(p); assertEquals( List.of( - new LocaleInheritanceInfo( - XMLSource.CODE_FALLBACK_ID, GERMAN, Reason.constructed), new LocaleInheritanceInfo( XMLSource.ROOT_ID, "//ldml/localeDisplayNames/localeDisplayPattern/localePattern", From cdb5251d6bf84d2aac9a988bdb920aec526bf674 Mon Sep 17 00:00:00 2001 From: btangmu Date: Sun, 22 Dec 2024 23:00:39 -0800 Subject: [PATCH 3/6] CLDR-17014 Move code for language extra paths to new ExtraPaths.java -Create the set of language extra paths only once; related refactoring -Fix another part of testGetPaths so it passes, similar to previous commit -Comments --- .../java/org/unicode/cldr/util/CLDRFile.java | 42 ++------------- .../org/unicode/cldr/util/ExtraPaths.java | 52 +++++++++++++++++++ .../cldr/unittest/TestCoverageLevel.java | 2 +- .../org/unicode/cldr/util/TestCLDRFile.java | 2 - 4 files changed, 58 insertions(+), 40 deletions(-) create mode 100644 tools/cldr-code/src/main/java/org/unicode/cldr/util/ExtraPaths.java diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRFile.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRFile.java index ba17e77bd46..ac59e6f6142 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRFile.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRFile.java @@ -595,6 +595,10 @@ public String getStringValue(String xpath) { result = dataSource.getValueAtPath(fallbackPath); } } + // Note: the following can occur even when result != null at this point, and it can + // improve the result.For example, the code above may give "zh_Hans (FONIPA)", while the + // constructed value gotten below is "xitoy [soddalashgan] (FONIPA)" (in locale uz), + // which is expected by TestLocaleDisplay. if (isResolved() && GlossonymConstructor.valueIsBogus(result) && GlossonymConstructor.pathIsEligible(xpath)) { @@ -3150,7 +3154,7 @@ private List getRawExtraPathsPrivate() { SupplementalDataInfo supplementalData = CLDRConfig.getInstance().getSupplementalDataInfo(); // languages - getLanguageExtraPaths(toAddTo); + ExtraPaths.appendLanguages(toAddTo); // units PluralInfo plurals = supplementalData.getPlurals(PluralType.cardinal, getLocaleID()); @@ -3343,42 +3347,6 @@ private List getRawExtraPathsPrivate() { return toAddTo.stream().map(String::intern).collect(Collectors.toList()); } - private void getLanguageExtraPaths(Set toAddTo) { - Set codes = - StandardCodes.make().getSurveyToolDisplayCodes(NameType.LANGUAGE.getNameName()); - codes.remove(XMLSource.ROOT_ID); - String[] extraCodes = { - "ar_001", "de_AT", "de_CH", "en_AU", "en_CA", "en_GB", "en_US", "es_419", "es_ES", - "es_MX", "fa_AF", "fr_CA", "fr_CH", "frc", "hi_Latn", "lou", "nds_NL", "nl_BE", - "pt_BR", "pt_PT", "ro_MD", "sw_CD", "zh_Hans", "zh_Hant" - }; - codes.addAll(List.of(extraCodes)); - for (Iterator codeIt = codes.iterator(); codeIt.hasNext(); ) { - String code = codeIt.next(); - String fullpath = NameType.LANGUAGE.getKeyPath(code); - toAddTo.add(fullpath); - } - toAddTo.add(languageAltPath("en_GB", "short")); - toAddTo.add(languageAltPath("en_US", "short")); - toAddTo.add(languageAltPath("az", "short")); - toAddTo.add(languageAltPath("ckb", "menu")); - toAddTo.add(languageAltPath("ckb", "variant")); - toAddTo.add(languageAltPath("hi_Latn", "variant")); - toAddTo.add(languageAltPath("yue", "menu")); - toAddTo.add(languageAltPath("zh", "menu")); - toAddTo.add(languageAltPath("zh_Hans", "long")); - toAddTo.add(languageAltPath("zh_Hant", "long")); - } - - private String languageAltPath(String code, String alt) { - String fullpath = NameType.LANGUAGE.getKeyPath(code); - // Insert the @alt= string after the last occurrence of "]" - StringBuffer fullpathBuf = new StringBuffer(fullpath); - return fullpathBuf - .insert(fullpathBuf.lastIndexOf("]") + 1, "[@alt=\"" + alt + "\"]") - .toString(); - } - private void addPluralCounts( Collection toAddTo, final Set pluralCounts, diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/ExtraPaths.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/ExtraPaths.java new file mode 100644 index 00000000000..780f180370a --- /dev/null +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/ExtraPaths.java @@ -0,0 +1,52 @@ +package org.unicode.cldr.util; + +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +public class ExtraPaths { + + private static final Collection languagePaths = new HashSet<>(); + + static void appendLanguages(Collection toAddTo) { + if (languagePaths.isEmpty()) { + populateLanguagePaths(); + } + toAddTo.addAll(languagePaths); + } + + private static void populateLanguagePaths() { + StandardCodes sc = StandardCodes.make(); + Set codes = sc.getGoodAvailableCodes(StandardCodes.CodeType.language); + codes.remove(LocaleNames.ROOT); + codes.addAll( + List.of( + "ar_001", "de_AT", "de_CH", "en_AU", "en_CA", "en_GB", "en_US", "es_419", + "es_ES", "es_MX", "fa_AF", "fr_CA", "fr_CH", "frc", "hi_Latn", "lou", + "nds_NL", "nl_BE", "pt_BR", "pt_PT", "ro_MD", "sw_CD", "zh_Hans", + "zh_Hant")); + for (String code : codes) { + languagePaths.add(NameType.LANGUAGE.getKeyPath(code)); + } + languagePaths.add(languageAltPath("en_GB", "short")); + languagePaths.add(languageAltPath("en_US", "short")); + languagePaths.add(languageAltPath("az", "short")); + languagePaths.add(languageAltPath("ckb", "menu")); + languagePaths.add(languageAltPath("ckb", "variant")); + languagePaths.add(languageAltPath("hi_Latn", "variant")); + languagePaths.add(languageAltPath("yue", "menu")); + languagePaths.add(languageAltPath("zh", "menu")); + languagePaths.add(languageAltPath("zh_Hans", "long")); + languagePaths.add(languageAltPath("zh_Hant", "long")); + } + + private static String languageAltPath(String code, String alt) { + String fullpath = NameType.LANGUAGE.getKeyPath(code); + // Insert the @alt= string after the last occurrence of "]" + StringBuilder fullpathBuf = new StringBuilder(fullpath); + return fullpathBuf + .insert(fullpathBuf.lastIndexOf("]") + 1, "[@alt=\"" + alt + "\"]") + .toString(); + } +} diff --git a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCoverageLevel.java b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCoverageLevel.java index e3b3620d405..d398241ac78 100644 --- a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCoverageLevel.java +++ b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCoverageLevel.java @@ -1060,7 +1060,7 @@ private String stringForm(Level level2) { } } - public void testLSR() { + public void testLSR() { // LSR = Language/Script/Region SupplementalDataInfo supplementalData = testInfo.getSupplementalDataInfo(); org.unicode.cldr.util.Factory factory = testInfo.getCldrFactory(); CLDRFile root = factory.make(LocaleNames.ROOT, true); diff --git a/tools/cldr-code/src/test/java/org/unicode/cldr/util/TestCLDRFile.java b/tools/cldr-code/src/test/java/org/unicode/cldr/util/TestCLDRFile.java index 961ac1e36a7..f7777f8b1ea 100644 --- a/tools/cldr-code/src/test/java/org/unicode/cldr/util/TestCLDRFile.java +++ b/tools/cldr-code/src/test/java/org/unicode/cldr/util/TestCLDRFile.java @@ -319,8 +319,6 @@ public void testGetPaths() { List pwf = f.getPathsWhereFound(p); assertEquals( List.of( - new LocaleInheritanceInfo( - XMLSource.CODE_FALLBACK_ID, GERMAN, Reason.constructed), new LocaleInheritanceInfo( XMLSource .CODE_FALLBACK_ID /* test data does not have this in root */, From aaf5e632c11323e924a55ed9fd8bd9267dace946 Mon Sep 17 00:00:00 2001 From: btangmu Date: Mon, 23 Dec 2024 09:15:17 -0800 Subject: [PATCH 4/6] CLDR-17014 Debugging and minor optimization --- .../java/org/unicode/cldr/unittest/TestCoverageLevel.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCoverageLevel.java b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCoverageLevel.java index d398241ac78..a5c65b53d7d 100644 --- a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCoverageLevel.java +++ b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCoverageLevel.java @@ -51,6 +51,7 @@ import org.unicode.cldr.util.LocaleNames; import org.unicode.cldr.util.LogicalGrouping; import org.unicode.cldr.util.LogicalGrouping.PathType; +import org.unicode.cldr.util.NameGetter; import org.unicode.cldr.util.NameType; import org.unicode.cldr.util.Organization; import org.unicode.cldr.util.PathHeader; @@ -1098,6 +1099,8 @@ public void testLSR() { // LSR = Language/Script/Region scriptsRoot = ImmutableSet.copyOf(scriptsRoot); regionsRoot = ImmutableSet.copyOf(regionsRoot); + System.out.println("testLSR: langsRoot.size = " + langsRoot.size()); + // get CLDR locale IDs' codes // the maps are from codes (like en) to the best level in the CLDR Organization. @@ -1141,6 +1144,7 @@ public void testLSR() { // LSR = Language/Script/Region NameType.TERRITORY, Row.of("region", regions, regionsRoot, Level.MODERATE)); + NameGetter englishNameGetter = testInfo.getEnglish().nameGetter(); for (Entry, Set, Level>> typeAndInfo : typeToInfo.entrySet()) { NameType type = typeAndInfo.getKey(); @@ -1152,8 +1156,7 @@ public void testLSR() { // LSR = Language/Script/Region typeAndInfo.getValue().get3(); // it looks like the targetLevel is ignored for (String code : Sets.union(idPartMap.keySet(), setRoot)) { - String displayName = - testInfo.getEnglish().nameGetter().getNameFromTypeEnumCode(type, code); + String displayName = englishNameGetter.getNameFromTypeEnumCode(type, code); String path = type.getKeyPath(code); Level level = coverageLevel.getLevel(path); data.put( From e3f2f32a1358c567ab52f424026c05907ee9786d Mon Sep 17 00:00:00 2001 From: btangmu Date: Mon, 23 Dec 2024 14:22:52 -0800 Subject: [PATCH 5/6] CLDR-17014 Fix testLSR using root.fullIterable() --- .../src/main/java/org/unicode/cldr/util/CLDRFile.java | 2 +- .../java/org/unicode/cldr/unittest/TestCoverageLevel.java | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRFile.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRFile.java index ac59e6f6142..8236dd958d1 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRFile.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRFile.java @@ -3535,7 +3535,7 @@ public String getFillInValue(String distinguishedPath) { public boolean isNotRoot(String distinguishedPath) { String source = getSourceLocaleID(distinguishedPath, null); return source != null - && !source.equals("root") + && !source.equals(LocaleNames.ROOT) && !source.equals(XMLSource.CODE_FALLBACK_ID); } diff --git a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCoverageLevel.java b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCoverageLevel.java index a5c65b53d7d..95bb801818f 100644 --- a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCoverageLevel.java +++ b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestCoverageLevel.java @@ -1063,6 +1063,7 @@ private String stringForm(Level level2) { public void testLSR() { // LSR = Language/Script/Region SupplementalDataInfo supplementalData = testInfo.getSupplementalDataInfo(); + org.unicode.cldr.util.Factory factory = testInfo.getCldrFactory(); CLDRFile root = factory.make(LocaleNames.ROOT, true); CoverageLevel2 coverageLevel = @@ -1074,7 +1075,7 @@ public void testLSR() { // LSR = Language/Script/Region // Get root LSR codes - for (String path : root) { + for (String path : root.fullIterable()) { if (!path.startsWith("//ldml/localeDisplayNames/")) { continue; } @@ -1099,8 +1100,6 @@ public void testLSR() { // LSR = Language/Script/Region scriptsRoot = ImmutableSet.copyOf(scriptsRoot); regionsRoot = ImmutableSet.copyOf(regionsRoot); - System.out.println("testLSR: langsRoot.size = " + langsRoot.size()); - // get CLDR locale IDs' codes // the maps are from codes (like en) to the best level in the CLDR Organization. From 518b994ce35ecb708500f28e0622f4790e2c0529 Mon Sep 17 00:00:00 2001 From: btangmu Date: Mon, 23 Dec 2024 19:45:14 -0800 Subject: [PATCH 6/6] CLDR-17014 Fix populateLanguagePaths bug -Do not modify SupplementalDataInfo.CLDRLanguageCodes, returned by sc.getGoodAvailableCodes! --- .../src/main/java/org/unicode/cldr/util/ExtraPaths.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/ExtraPaths.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/ExtraPaths.java index 780f180370a..72f9fa33735 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/ExtraPaths.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/ExtraPaths.java @@ -4,6 +4,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import java.util.TreeSet; public class ExtraPaths { @@ -17,8 +18,9 @@ static void appendLanguages(Collection toAddTo) { } private static void populateLanguagePaths() { + Set codes = new TreeSet<>(); StandardCodes sc = StandardCodes.make(); - Set codes = sc.getGoodAvailableCodes(StandardCodes.CodeType.language); + codes.addAll(sc.getGoodAvailableCodes(StandardCodes.CodeType.language)); codes.remove(LocaleNames.ROOT); codes.addAll( List.of(