0

I'm trying to add a default language for my android app using Account Kit without success. I don't want for now make a support for english, but when the device are using english as the system language the Account Kit changes too.

I'm following the docs, so I have set the resCongis in my build.gralde file

defaultConfig {
    applicationId "fm.mumo.music"
    minSdkVersion 15
    targetSdkVersion 25
    versionCode 16
    versionName "0.3.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    multiDexEnabled = true
    resConfigs "pt-rBR"
    resValue "string", "facebook_app_id", "$alphaFacebookAppId"
    resValue "string", "account_kit_client_token", "$alphaAccountKitClientToken"
}
pablobaldez
  • 924
  • 14
  • 22

1 Answers1

1

The resConfigs "pt-rBR" bit is used to strip out all Locales that are not listed there. That won't take out the default language, which in this case is English. If you are trying to 'replace' the default Locale you could do something like this:

In your Activity or Application you can do the following to 'force' the Locale if you know the user's Locale is not supported. This would be one way of 'swapping' the default Locale.

Configuration localeConfig = getResources().getConfiguration();
  localeConfig.locale = Locale.FRENCH;
  getResources().updateConfiguration(localeConfig, getResources().getDisplayMetrics());

But you would have to be careful to only do this if the Locale.getDefault() is known to not be supported and thus the AccountKit default (English) would be shown.

astryk
  • 1,256
  • 13
  • 20