How do I set the default locale in the JVM?

前端 未结 7 1044
半阙折子戏
半阙折子戏 2020-11-22 11:42

I want to set the default Locale for my JVM to fr_CA. What are the possible options to do this?

I know of only one option Locale.setD

7条回答
  •  死守一世寂寞
    2020-11-22 11:52

    You can do this:

    And to capture locale. You can do this:

    private static final String LOCALE = LocaleContextHolder.getLocale().getLanguage()
                + "-" + LocaleContextHolder.getLocale().getCountry();
    

提交回复
热议问题