Android - force app language
complete
R
Richárd Radics
Hi Team,
We have a problem with the latest Android SDK.
If we force the application language to a different than the device language, the localization of the SDK UI is getting mixed.
It was working with the SDK version 16.1.0. After updating to 16.2.0 we face the issue above.
Log In
Mislav Stanic
complete
Fixed with Shake 16.2.1
Mislav Stanic
in progress
Mislav Stanic
planned
R
Richárd Radics
Hello,
We use the 2nd technique to force the app's language from this article:
xxx
fun updateLocale(
configuration: Configuration,
context: Context,
language: Language
): Configuration {
val locale = Locale(language.toLanguageCode())
Locale.setDefault(locale)
val newConfiguration = Configuration(configuration)
newConfiguration.setLocales(LocaleList(locale))
updateResources(newConfiguration, context)
return newConfiguration
}
xxx
private fun updateResources(configuration: Configuration, context: Context) {
val resources = context.resources
resources.updateConfiguration(configuration, resources.displayMetrics)
}
xxx
If the device language is Hungarian, but the user sets in our application the app's language to English, the Shakebugs SDK version 16.1.0 opens in English. However, if we update the Shakebugs SDK to version 16.2.0, it opens in a mixed way: the texts are in English and in Hungarian.
Mislav Stanic
Richárd Radics: Thank you.
You are correct. We have made some changes regarding translations to support better RN and Flutter. With these changes the behavior of translating while already in the app is affected. We'll put this to the roadmap to make it work.
Mislav Stanic
Hi,
We'd need more details about the issue you are facing.
Is it happening for you always, have you tried closing and entering the app again?
Can you describe how do you force language for your app?