How to set a standard i18n locale using spring-boot and thymeleaf?
<p>I integrated i18n to my application using the following config:</p>

<pre><code>@Configuration
public class LocaleConfiguration extends WebMvcConfigurerAdapter {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        LocaleChangeInterceptor localeChangeInterceptor = new LocaleChangeInterceptor();
        localeChangeInterceptor.setParamName("lang");
        registry.addInterceptor(localeChangeInterceptor);
    }

    @Bean
    public MessageSource messageSource() {
        ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
        messageSource.setBasename("classpath:/i18n/application");
        messageSource.setDefaultEncoding("UTF-8");
        return messageSource;
    }

}
</code></pre>

<p>I set up properties for "en" and "de" and everything is working fine so far. </p>

<p>If I enter the page from spain for example I only see the placeholder from my html file. But instead of this I want to achieve that the standard language is english ("en") for languages/countries with no existing property config. So I tried this:</p>

<pre><code>@Bean
public LocaleResolver localeResolver() {
    SessionLocaleResolver sessionLocaleResolver = new SessionLocaleResolver();
    sessionLocaleResolver.setDefaultLocale(Locale.US);
    return sessionLocaleResolver;
}
</code></pre>

<p>It sets the default to english as I want but now every page (also with existing property for the special language) is displayed in english.</p>