Checking if an Android phone has a specific language

How can I programmatically check if the phone has a specific language?

+4
source share
1 answer

You can get the Locale array using getAvailableLocales() , and then scroll through it to see if it is available.

 boolean hasLocale = false; String myLocale = "en"; Locale[] locales = Locale.getAvailableLocales(); for (Locale locale : locales) { if (locale.getLanguage().equals(myLocale)) { hasLocale = true; } } // Value of `hasLocale` is what you want here! 
+3
source

All Articles