From d1e5785dad98184008356f05807e42d0c156e91d Mon Sep 17 00:00:00 2001 From: Gabriel Luong Date: Sat, 17 Oct 2020 09:40:28 -0400 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/15796 - Use the device locale for the system locale subtitle (https://github.com/mozilla-mobile/fenix/pull/15975) --- .../mozilla/fenix/settings/advanced/LocaleViewHolders.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/settings/advanced/LocaleViewHolders.kt b/app/src/main/java/org/mozilla/fenix/settings/advanced/LocaleViewHolders.kt index 7d72a58f8a..2a2fb431b6 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/advanced/LocaleViewHolders.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/advanced/LocaleViewHolders.kt @@ -20,8 +20,9 @@ class LocaleViewHolder( ) : BaseLocaleViewHolder(view, selectedLocale) { override fun bind(locale: Locale) { - // capitalisation is done using the rules of the appropriate locale (endonym and exonym) + // Capitalisation is done using the rules of the appropriate locale (endonym and exonym). locale_title_text.text = locale.getDisplayName(locale).capitalize(locale) + // Show the given locale using the device locale for the subtitle. locale_subtitle_text.text = locale.displayName.capitalize(Locale.getDefault()) locale_selected_icon.isVisible = isCurrentLocaleSelected(locale, isDefault = false) @@ -39,7 +40,8 @@ class SystemLocaleViewHolder( override fun bind(locale: Locale) { locale_title_text.text = itemView.context.getString(R.string.default_locale_text) - locale_subtitle_text.text = locale.displayName.capitalize(Locale.getDefault()) + // Use the device locale for the system locale subtitle. + locale_subtitle_text.text = locale.getDisplayName(locale).capitalize(locale) locale_selected_icon.isVisible = isCurrentLocaleSelected(locale, isDefault = true) itemView.setOnClickListener { interactor.onDefaultLocaleSelected()