diff --git a/app/src/common/shared/org/mozilla/vrbrowser/utils/LocaleUtils.java b/app/src/common/shared/org/mozilla/vrbrowser/utils/LocaleUtils.java index fca8a5bb9..970363ae4 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/utils/LocaleUtils.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/utils/LocaleUtils.java @@ -52,7 +52,6 @@ private static HashMap getAllLanguages() { return mLanguagesCache; } - String currentLocale = getCurrentLocale(); Locale[] locales = Locale.getAvailableLocales(); mLanguagesCache = new HashMap<>(); for(Locale temp : locales) { @@ -184,8 +183,7 @@ public static Context setLocale(@NonNull Context context) { } private static Context updateResources(@NonNull Context context, @NonNull String language) { - String[] localeStr = language.split("-"); - Locale locale = new Locale(localeStr[0], localeStr.length > 1 ? localeStr[1] : ""); + Locale locale = Locale.forLanguageTag(language); Locale.setDefault(locale); Resources res = context.getResources();