Ivan Šiser
10/09/2024, 12:56 PMval appLocale: LocaleListCompat = LocaleListCompat.forLanguageTags("en")
AppCompatDelegate.setApplicationLocales(appLocale)
and inside AndroidManifest.xml:
android:configChanges="locale|layoutDirection"
But still LocalConfiguration.current.locales[0]
does not change until activity is recreated.Stylianos Gakis
10/09/2024, 2:59 PM@Composable
@ReadOnlyComposable
fun getLocale(): Locale {
val configuration = LocalConfiguration.current
return ConfigurationCompat.getLocales(configuration).get(0) ?: LocaleListCompat.getAdjustedDefault()[0]!!
}
Do you experience the same problem?Alex Vanyo
10/09/2024, 7:34 PM