[Regional Preferences] Remove u extension for subtitle of Language

- Remove the language tag info of subtitle in  Settings -> System -> Languages
 - Syuc same result to entry of numbering system.

Bug: b/268278327
Bug: b/268276472
Test: atest passed
Test: Manual test passed
Change-Id: I46dd0899059e9209b99f5ef3b7b84eb083d4e140
This commit is contained in:
tom hsu
2023-02-08 21:24:53 +08:00
parent 6f76d5dc91
commit e2aeded3de
4 changed files with 89 additions and 95 deletions

View File

@@ -27,10 +27,16 @@ public class LocaleFeatureProviderImpl implements LocaleFeatureProvider {
@Override
public String getLocaleNames() {
final LocaleList locales = LocalePicker.getLocales();
Locale[] arrLocalesWithoutExtension = new Locale[locales.size()];
for (int i = 0; i < locales.size(); i++) {
arrLocalesWithoutExtension[i] = locales.get(i).stripExtensions();
}
final Locale displayLocale = Locale.getDefault();
return LocaleHelper.toSentenceCase(
LocaleHelper.getDisplayLocaleList(
locales, displayLocale, 2 /* Show up to two locales from the list */),
new LocaleList(arrLocalesWithoutExtension),
displayLocale,
2 /* Show up to two locales from the list */),
displayLocale);
}
}