My current Android application targets Android versions 21 to 34.
I am attempting to implement Per App Language in this application and for Android versions 33+ it appears to be working as expected.
However it not working correctly for Android versions < 33.
I have a broadcast receiver that has the following entry in the Android manifest which works fine for >= 33, however it is not triggered at all for < 33
<receiver android:name="my.receiver.LocaleChangeReceiver"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.LOCALE_CHANGED" />
<action android:name="android.intent.action.APPLICATION_LOCALE_CHANGED" />
</intent-filter>
</receiver>
also what is not working as desired is when a execute the following code:-
val appLocale: LocaleListCompat = LocaleListCompat.forLanguageTags("en")
AppCompatDelegate.setApplicationLocales(appLocale)
or
val appLocale: LocaleListCompat = LocaleListCompat.forLanguageTags("el")
AppCompatDelegate.setApplicationLocales(appLocale)
nothing happens to the displayed text in my application until i exit it, force close it and re start it, when the text is now in the selected language.
for Android < 33 i have added the following to my project
in the app gradle
resConfigs "en", "el"
resourceConfigurations += ["en", "el"]
how do you implement Per App Language on Android devices < 33?