We have a setLocale function as following:
public static void setLocale(Context context, String locale) {
Locale myLocale = new Locale(locale);
Resources res = context.getResources();
DisplayMetrics dm = res.getDisplayMetrics();
Configuration conf = res.getConfiguration();
conf.locale = myLocale;
res.updateConfiguration(conf, dm);
}
We use above method as follows:
sessionManager.setAppLanguage(locale, this);
setLocale(context,sessionManager.getAppLanguage(this));
We are using following locales:
English = "en";
Hindi = "hi";
Marathi = "ma";
But everytime when we open a camera, capture a photo, some labels get reset to default language and some labels remain in selected language. This happens in case of selecting photo from gallery also.
Note: Issue is device specific. Now we are seeing in Samsung star pro (KITKAT 4.1) and Sony Xperia E3 dual (KITKAT 4.4.4)
It might happen that you are calling the setLocale method in your Activity initialization, such as in onCreate method. You might want to call it in onActivityResult also.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With