1

i.e. If a device is running in a particular language (Say Spanish) then how can I set the Spanish language(After translation) as the default language of the app without asking the user.

The app should initialize in the Spanish language in this case while installation and a user should be able to change the language from the setting page of the app.

  • 1
    Possible duplicate of [Change language programmatically in Android](http://stackoverflow.com/questions/2900023/change-language-programmatically-in-android) – Vyacheslav Apr 03 '17 at 12:13
  • 1
    It already is the default language. – Markus Kauppinen Apr 03 '17 at 12:13
  • also a possible duplicate of [Stackoverflow change-the-locale-at-runtime](http://stackoverflow.com/questions/13181847/change-the-locale-at-runtime/) – k3b Apr 03 '17 at 12:42

2 Answers2

0

You need to add all string.xml files in specific language values folder. So when your user change mobile default language your app may take string values from that particular language values strings.xml file.

Chetan Joshi
  • 5,582
  • 4
  • 30
  • 43
0

By Locale, you can get a currently selected language of a device. Please have a look below code to get the language.

Locale.getDefault().getDisplayLanguage();
Hitesh Dhamshaniya
  • 2,088
  • 2
  • 16
  • 23