How can I force Grails to use only one language?

前端 未结 4 1275
梦如初夏
梦如初夏 2021-02-05 12:29

I want to make my Grails application support only one language, that I can define somewhere, completely ignoring the client\'s headers or the \"lang\" parameter. Is there any wa

4条回答
  •  轮回少年
    2021-02-05 13:32

    This worked for me in order to override the default localResolver bean

    beans = {
        localeResolver(org.springframework.web.servlet.i18n.FixedLocaleResolver) {
            setLocale(Locale.US)
        }
    }
    

提交回复
热议问题