I made an application with 2 string files. 1. strings.xml inside values 2. strings.xml inside values-kn
The code to translate when my user selects kannada is as follows:
Locale locale = new Locale(language);
Locale.setDefault(locale);
Configuration config = new Configuration();
config.locale = locale;
getBaseContext()
.getResources()
.updateConfiguration(config, getBaseContext()
.getResources()
.getDisplayMetrics());
This code works fine when I make a debug build or a release build and run it on different android phones. But when I upload the app bundle to the play store it does not update my language in that build. I also added a translation in the play store for kn-in but still I am not being able to translate my texts in the app to kannada.
Can somebody please explain what I am doing wrong here or am I missing out on something? This problem has been eating my brains out.