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

后端 未结 4 1459
暗喜
暗喜 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:31

    Or you could use Locale us = Locale.forLanguageTag("en-US") and us.toLanguageTag(), and that will do the conversion for you without having to create your own error-prone implementation.

提交回复
热议问题