How does Spring boot internationalize form validation @ Validated customize the resource folder?

Spring boot form validation @ Validated message internationalization resource files must be placed in resources/ValidationMessages.properties by default.

now I want to put the resource file in resources/i18n/validation/message.properties . How can I modify it?

found some information on the Internet and tried the following code, but it still didn"t work

@Configuration
public class ValidationConfig {

    @Bean
    public Validator getValidator() {
        ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
        messageSource.setBasename("i18n/validation/message.properties");

        LocalValidatorFactoryBean validator = new LocalValidatorFactoryBean();
        validator.setValidationMessageSource(messageSource);

        return validator;
    }

}
Mar.09,2021

this can be configured

@Configuration
public class ValidationConfig {

    @Bean
    public Validator getValidator() {
        Validator validator = Validation.byDefaultProvider().
        configure().
        messageInterpolator(new ResourceBundleMessageInterpolator(new PlatformResourceBundleLocator("i18n/validation/message"))).
        buildValidatorFactory().getValidator();
        return validator;
    }

}

messageSource.setBasename ("i18n/validation/message.properties");
changed to:
messageSource.setBasename ("i18n/validation/message");

Menu