Skip to content

Commit

Permalink
en-US support for BreakIterator/Collator in Fallback provider
Browse files Browse the repository at this point in the history
  • Loading branch information
naotoj committed Nov 6, 2023
1 parent ffef327 commit c0a93f5
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

package sun.util.locale.provider;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

/*
Expand All @@ -49,8 +51,12 @@ public LocaleProviderAdapter.Type getAdapterType() {
@Override
protected Set<String> createLanguageTagSet(String category) {
return switch (category) {
case "BreakIteratorInfo", "BreakIteratorRules", "CollationData"
-> super.createLanguageTagSet(category);
case "BreakIteratorInfo", "BreakIteratorRules", "CollationData" -> {
// ensure to include en-US
var s = new HashSet<>(super.createLanguageTagSet(category));
s.add("en-US");
yield Collections.unmodifiableSet(s);
}
case "FormatData" -> Set.of("ja", "und");
default -> Set.of("und");
};
Expand Down

0 comments on commit c0a93f5

Please sign in to comment.