Skip to content

Commit 457157a

Browse files
committed
ICU-22923 Workaround for addLikelySubtags(und-Latn-RS) bug
1 parent cc9adb6 commit 457157a

File tree

8 files changed

+2039
-2044
lines changed

8 files changed

+2039
-2044
lines changed

icu4c/source/data/misc/langInfo.txt

+2,030-2,028
Large diffs are not rendered by default.

icu4c/source/data/unit/da.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -2444,9 +2444,9 @@ da{
24442444
}
24452445
pressure{
24462446
inch-ofhg{
2447-
dnam{"# Hg"}
2448-
one{"{0} # Hg"}
2449-
other{"{0} # Hg"}
2447+
dnam{" Hg"}
2448+
one{"{0} Hg"}
2449+
other{"{0} Hg"}
24502450
}
24512451
millimeter-ofhg{
24522452
dnam{"mmHg"}

icu4c/source/test/intltest/loctest.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -5923,11 +5923,6 @@ testLikelySubtagsLineFn(void *context,
59235923
return;
59245924
}
59255925

5926-
if ((uprv_strcmp(source.c_str(), "und-Latn-RS") == 0 )
5927-
&& THIS->logKnownIssue("ICU-22976", "unexpected likely subtags for und-Latn-RS")) {
5928-
return;
5929-
}
5930-
59315926
Locale actualMax(l);
59325927
actualMax.addLikelySubtags(*pErrorCode);
59335928
if (addLikely == "FAIL") {

icu4j/main/common_tests/src/test/java/com/ibm/icu/dev/test/util/ULocaleTest.java

+3-7
Original file line numberDiff line numberDiff line change
@@ -5723,13 +5723,9 @@ public void likelySubtagsDataDriven(TestCase test) {
57235723
assertEquals("addLikelySubtags(" + test.source + ") should be unchanged",
57245724
l, ULocale.addLikelySubtags(l));
57255725
} else {
5726-
if (test.source.equals("und-Latn-RS")
5727-
&& logKnownIssue("ICU-23052", "addLikelySubtags(und-Latn-RS) bug") ) {
5728-
return;
5729-
}
5730-
assertEquals("addLikelySubtags(" + test.source + ")",
5731-
test.addLikely, ULocale.addLikelySubtags(l).toLanguageTag());
5732-
}
5726+
assertEquals("addLikelySubtags(" + test.source + ")",
5727+
test.addLikely, ULocale.addLikelySubtags(l).toLanguageTag());
5728+
}
57335729
if (test.removeFavorRegion.equals("FAIL")) {
57345730
assertEquals("minimizeSubtags(" + test.source + ") should be unchanged",
57355731
l, ULocale.minimizeSubtags(l));
Binary file not shown.
Binary file not shown.
Binary file not shown.

tools/cldr/cldr-to-icu/src/main/java/org/unicode/icu/tool/cldrtoicu/localedistance/LikelySubtagsBuilder.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,10 @@ private static Map<String, Map<String, Map<String, LSR>>> makeTable(
270270

271271
// Add the special case for "und-Latn" => "en-Latn-US" (which is a bit of a
272272
// hack for language matching).
273-
// TODO: Find out the history of this line and document it better.
273+
// Temporary patch. Needs an update of the ICU algorithm to match CLDR.
274+
// See https://unicode-org.atlassian.net/browse/ICU-23052
274275
set(lsrTable, "und", "Latn", "", lsr("en", "Latn", "US"));
276+
set(lsrTable, "und", "Latn", "RS", lsr("sr", "Latn", "RS"));
275277
logger.fine(lsrTable::toString);
276278

277279
// Ensure that if "und-RR" => "ll-Ssss-RR", then we also add "Ssss" => "RR".

0 commit comments

Comments
 (0)