I created a Spring Boot web application that uses Thymeleaf as the template engine. I configured the MessageSource
to look for messages in a subfolder:
The way I resolved the i18n messaging was to define the MessagesSource
bean like you. Additionally I had to override the getValidator()
method of the WebMvcConfigurerAdapter
.
@Override
public Validator getValidator() {
LocalValidatorFactoryBean validator = new LocalValidatorFactoryBean();
validator.setValidationMessageSource( messageSource() );
return validator;
}
After this, it worked for me.