File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed
grails-plugin-i18n/src/main/groovy/org/grails/plugins/i18n Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 1+ package org .grails .plugins .i18n ;
2+
3+ import org .springframework .boot .autoconfigure .AutoConfiguration ;
4+ import org .springframework .boot .autoconfigure .condition .ConditionalOnMissingBean ;
5+ import org .springframework .boot .autoconfigure .condition .ConditionalOnWebApplication ;
6+ import org .springframework .boot .autoconfigure .web .servlet .WebMvcAutoConfiguration ;
7+ import org .springframework .context .annotation .Bean ;
8+ import org .springframework .web .servlet .DispatcherServlet ;
9+ import org .springframework .web .servlet .LocaleResolver ;
10+ import org .springframework .web .servlet .i18n .SessionLocaleResolver ;
11+
12+ @ AutoConfiguration (before = { WebMvcAutoConfiguration .class })
13+ @ ConditionalOnWebApplication (type = ConditionalOnWebApplication .Type .SERVLET )
14+ public class I18nAutoConfiguration {
15+
16+ @ Bean
17+ @ ConditionalOnMissingBean (name = DispatcherServlet .LOCALE_RESOLVER_BEAN_NAME )
18+ public LocaleResolver localeResolver () {
19+ return new SessionLocaleResolver ();
20+ }
21+ }
Original file line number Diff line number Diff line change @@ -63,8 +63,6 @@ class I18nGrailsPlugin extends Plugin {
6363 localeChangeInterceptor(ParamsAwareLocaleChangeInterceptor ) {
6464 paramName = " lang"
6565 }
66-
67- localeResolver(SessionLocaleResolver )
6866 }}
6967
7068 @Override
You can’t perform that action at this time.
0 commit comments