File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
grails-plugin-i18n/src/main/groovy/org/grails/plugins/i18n Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 11package org .grails .plugins .i18n ;
22
3+ import org .grails .web .i18n .ParamsAwareLocaleChangeInterceptor ;
34import org .springframework .boot .autoconfigure .AutoConfiguration ;
45import org .springframework .boot .autoconfigure .condition .ConditionalOnMissingBean ;
56import org .springframework .boot .autoconfigure .condition .ConditionalOnWebApplication ;
67import org .springframework .boot .autoconfigure .web .servlet .WebMvcAutoConfiguration ;
78import org .springframework .context .annotation .Bean ;
89import org .springframework .web .servlet .DispatcherServlet ;
910import org .springframework .web .servlet .LocaleResolver ;
11+ import org .springframework .web .servlet .i18n .LocaleChangeInterceptor ;
1012import org .springframework .web .servlet .i18n .SessionLocaleResolver ;
1113
1214@ AutoConfiguration (before = { WebMvcAutoConfiguration .class })
@@ -18,4 +20,10 @@ public class I18nAutoConfiguration {
1820 public LocaleResolver localeResolver () {
1921 return new SessionLocaleResolver ();
2022 }
23+
24+ public LocaleChangeInterceptor localeChangeInterceptor () {
25+ ParamsAwareLocaleChangeInterceptor localeChangeInterceptor = new ParamsAwareLocaleChangeInterceptor ();
26+ localeChangeInterceptor .setParamName ("lang" );
27+ return localeChangeInterceptor ;
28+ }
2129}
Original file line number Diff line number Diff line change @@ -59,10 +59,6 @@ class I18nGrailsPlugin extends Plugin {
5959 }
6060 defaultEncoding = encoding
6161 }
62-
63- localeChangeInterceptor(ParamsAwareLocaleChangeInterceptor ) {
64- paramName = " lang"
65- }
6662 }}
6763
6864 @Override
You can’t perform that action at this time.
0 commit comments