Why does Locale.getDefault().getLanguage() in Android return the display name instead of the language code?

前端 未结 4 1022
青春惊慌失措
青春惊慌失措 2021-02-14 02:56

According to the Java reference, Locale.getLanguage() is supposed to return the 2-letters lowercase ISO code of the language (e.g. en), while get

4条回答
  •  有刺的猬
    2021-02-14 02:57

    I don't know why this issue appears, but another standard for languages is the ISO3 code. You can call Locale.getDefault().getISO3Language() and it should return "eng" or "esp".

提交回复
热议问题