I am facing issue with setting in app locale to zh_HK. The code Locale locale=new Locale("zh_HK") also not working and upon printing locales.getAvailable locales list, I am getting zh_HK_#Hans,zh_HK_#Hant. Further more setting Locale locale=new Locale("zh_HK_#Hans") is also NOT working.
in the printed list of available locales it has no option like zh_HK. I am importing java.utils.Locale.
in your class that extands Application put this code :
public class myApp extends Application {
@Override
public void onCreate() {
super.onCreate();
Locale locale = new Locale("zh","HK");
Locale.setDefault(locale);
Configuration config = new Configuration();
config.locale = locale;
getApplicationContext().getResources().updateConfiguration(config, null);
}
}
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