0

It seems that Locale.getDefault().getLanguage() only returns the language code (e.g. en or zh). Is there a way to get the full language code and script (e.g. zh-hans and en-us)? Locale.getDefault().getScript() is API 21+, and it seems to return the empty string even on applicable OSes.

Jin
  • 6,055
  • 2
  • 39
  • 72

1 Answers1

0

Use simply toString

Locale.getDefault().toString()

Or if you need a script separately, take a look at How to get the script from a Locale object on Android?

Community
  • 1
  • 1
yital9
  • 6,544
  • 15
  • 41
  • 54