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
The default LocaleResolver
of Grails is SessionLocaleResolver
. If you want to always use de_DE you can change this to FixedLocaleResolver
.
beans {
localeResolver(FixedLocaleResolver) {
locale = new Locale("de", "DE")
}
}
If you want to restrict to a set of locales, then you will need a filter, and use the SessionLocaleResolver#setLocale(HttpServletRequest request, HttpServletResponse response, Locale locale)
method.