'Force Thymeleaf to retrieve different language value

I have 2 locales files:

messages.properties

welcome=Welcome

messages_fr.properties

welcome=Bienvenue

The template:

<div th:text="#{welcome}"></div>

I want to use the value of the key welcome from the 2 (en, fr) locales in the same session and the same template file. Something like:

<div th:text="#{welcome#en}"></div>
<div th:text="#{welcome#fr}"></div>

Can i achieve this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source