AccountKit UI language

a 夏天 提交于 2019-12-08 01:18:14

问题


I have an app with only support one language, Bahasa Indonesia. So how can I change the Facebook's accountKit language into our supported language?

I've try the guide which told me to put this config in the build.gradle and the accountKit UI is still in english.

defaultConfig {
    resConfigs "id"
}

Is there any way to change the language without changing the device language?


回答1:


I've got the solution! Just change the locale of the activity which contains the account kit and the UI language will be changed automatically. Here is a list of supported languages for Account Kit.

I've added following code to achieve Bengali language in onCreate() of the activity from which the Account Kit intent is called:

 String languageToLoad = "bn";
 Locale locale = new Locale(languageToLoad);
 Configuration config = new Configuration();
 config.locale = locale;
 getBaseContext().getResources().updateConfiguration(config, getBaseContext().getResources().getDisplayMetrics()); 

And the result is this :




回答2:


The Indonesian two letter code is usually "in" not "id".



来源:https://stackoverflow.com/questions/41303854/accountkit-ui-language

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!