Thmeleaf Message (i18n) expression

Posted by dogukanhan on September 03, 2018 · 1 min read

Spring Message Resolver Config

@Bean
@Description("Spring Message Resolver")
public ResourceBundleMessageSource messageSource() {
    ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
    messageSource.setBasename("messages");
    return messageSource;
}

messages.propertioes Dosyasi

name=dogukan

Thmeleaf html dosyasi

<p th:text="#{name}">Name</p>

Cikti

<p>dogukan</p>