I18n Springboot from an external library

Asked

Viewed 28 times

3

Gentlemen, in my system I have an external component that contains the messagesource bean configured as follows :

@Bean
public ReloadableResourceBundleMessageSource messageSource() {
    final ReloadableResourceBundleMessageSource source = new ReloadableResourceBundleMessageSource();
    source.setBasename("classpath:i18n/core/messages");
    source.setDefaultEncoding("UTF-8");
    source.setUseCodeAsDefaultMessage(true);
    return source;
}

However I need the exception messages to be displayed in the application that is importing it, something that is not occurring :

br.com.mv.liberty.editor3core.exception.vo.StudioException: group.length.max.description

How should I configure my application to display messages from this embedded component ?

1 answer

0

How the base is source.setBasename("classpath:i18n/core/messages");, you need to put the file messages.properties within the following directory:

 src/main/resources/i18n/core/message.properties

Browser other questions tagged

You are not signed in. Login or sign up in order to post.