Skip to content
Advertisement

Spring Boot & Thymeleaf – Localized text does not appear

I am currently working on the localization of my (second) Spring Boot project. However, I have come to a halt after several hours of struggling: I am unable to get a user-editable Session localization.

The problem appears to occur as soon as the user sends a GET request with the lang parameter. (travel down below to see the results I am getting)

Details

Spring Boot version:(3.0.0-M3)

Expected localized content

i18n/messages.properties is empty

i18n/messages_en_US.properties:

JavaScript

i18n/messages_fr_FR.properties:

JavaScript

i18n/messages_ja_JP.properties:

JavaScript

Configuration

application.properties (section related to this issue):

JavaScript

LocalizationConfiguration file:

JavaScript

Display

Page Controller:

JavaScript

Template loaded (international.html):

JavaScript

What is being displayed

Found result

As you can see in the above gif, the first display of the page shows the messages in the browser’s language. However, as soon as an other language is selected the page breaks apart, with the exception of the #locale parameter.

Advertisement

Answer

Try it.

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement