What is the difference between creating a locale for en-US and en_US?

后端 未结 4 1478
暗喜
暗喜 2020-12-08 18:53

I have all my ResourceBundle values in a table and formatted as per requirement. I have to change the languages on the website based on user selection in a drop

4条回答
  •  孤街浪徒
    2020-12-08 19:37

    "en" is the language code specified by ISO 639. while US is country code specified by 3166.
    In Java, the Locale object recognizes the language as languageCode_countryCode (e.g. en_US) and not as languageCode-countryCode.

提交回复
热议问题