Bahast Saber
Bahast Saber

Reputation: 3

Spring boot, Thymeleaf how do I get language parameter from webpage

I am developing a multi-language web app using Spring-boot. I have to get the current language of the web UI. id=s there any help?

Upvotes: 0

Views: 689

Answers (2)

Amir
Amir

Reputation: 1844

use for current language:

${#locale.language}

use for current country:

${#locale.country}

Upvotes: 2

jri
jri

Reputation: 485

The first thing that comes to my mind to get the Locale is this:

LocaleContextHolder.getLocale();

If you want to set the Locale you can use this:

setLocale(Locale locale);

For further information you can look here here.

Upvotes: 1

Related Questions