How can I get current locale in thymeleaf template? Thymeleaf context is locale aware, so it would be weird to inject locale on every request, is there some variable I can request in a template?
<div th:text="${currentLocale}"></div>
Use the #locale expression:
<div th:text="${#locale}"></div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With