Last active
February 2, 2019 11:03
-
-
Save linhvovn/91c8e90bdfed08a879573485aa17e7c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
public class WebConfig implements WebMvcConfigurer { | |
@Bean | |
public LocaleResolver localeResolver() { | |
return new CookieLocaleResolver(); | |
} | |
@Override | |
public void addInterceptors(InterceptorRegistry registry) { | |
LocaleChangeInterceptor localeChangeInterceptor = new LocaleChangeInterceptor(); | |
localeChangeInterceptor.setParamName("lang"); | |
registry.addInterceptor(localeChangeInterceptor); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment