Skip to content

Instantly share code, notes, and snippets.

@linhvovn
Last active February 2, 2019 11:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save linhvovn/91c8e90bdfed08a879573485aa17e7c0 to your computer and use it in GitHub Desktop.
Save linhvovn/91c8e90bdfed08a879573485aa17e7c0 to your computer and use it in GitHub Desktop.
@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