springboot localization | springboot i18n | springboot internalization | live demo | springboot thymeleaf | okay java
Buy me a coffee - https://www.buymeacoffee.com/okayjava
The LocaleResolver interface deals with locale resolution required when localizing web applications to specific locales.
SessionLocaleResolver
Resolves the locale and stores it in the HttpSession of the user. But as you might have wondered, yes, the resolved locale data is persisted only for as long as the session is live.
an interceptor – or interceptor? – bean that will intercept each request that the application receives, and eagerly check for a localeData parameter (language) on the HTTP request. If found, the interceptor uses the localeResolver
void addInterceptors - Override the addInterceptors method and add our locale change interceptor to the registry.