Capitalize TZ display name strings

Capitalize Settings UI time zone display name strings for languanges
like Polish for standalone locations like summaries and lists. The
motivating example case is the string for "Coordinated Universal Time"
in Polish, which is not capitalized in CLDR, as they capitalize for the
middle of sentences by default. In English, Coordinated Universal Time
is already capitalized, but the Polish string is not.

With this commit all "display name"-like strings have been capitalized
(region names, exemplar locations, time zone names like
"Coordinated Universal Time" and "British Summer Time") for
completeness. For the Polish case, many are already capitalized, but
capitalizing the first letter is therefore a no-op. The
"GMT+xx:xx"-style strings have not been changed.

Bug: 190109975
Test: Visual inspection in English and Polish of UTC, United States,
Russia in the time zone picker and the date & time screen on mobile

Change-Id: I57d915ac1e30e22cc05e605fcb7d46b102fa8ce1
This commit is contained in:
Neil Fuller
2022-04-05 15:31:10 +01:00
parent c68e241fa6
commit e7fd120d8e
4 changed files with 35 additions and 13 deletions

View File

@@ -16,6 +16,8 @@
package com.android.settings.datetime.timezone;
import static com.android.settingslib.datetime.ZoneGetter.capitalizeForStandaloneDisplay;
import android.app.settings.SettingsEnums;
import android.content.Intent;
import android.icu.text.Collator;
@@ -65,7 +67,8 @@ public class RegionZonePicker extends BaseTimeZoneInfoPicker {
final LocaleDisplayNames localeDisplayNames = LocaleDisplayNames.getInstance(getLocale());
final String regionId =
getArguments() == null ? null : getArguments().getString(EXTRA_REGION_ID);
mRegionName = regionId == null ? null : localeDisplayNames.regionDisplayName(regionId);
mRegionName = regionId == null ? null : capitalizeForStandaloneDisplay(
mLocale, localeDisplayNames.regionDisplayName(regionId));
}
@Override