Thmeleaf Message (i18n) expression

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>

 

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *