Freemarker (by default) uses the locale to build the file names it looks for when loading and including templates. For example, loading tos.ftl (the template) with the en_US locale would look for:
- tos_en_US.ftl
- tos_en.ftl
- tos.ftl
This can be useful to translate whole pages when the pages are completely different between different languages. For example, a "Terms of Service" page might be mostly static so different languages would have completely different content. In this case, it is a hassle to externalize the whole content to messages loaded from message bundles.
I am now learning Thymeleaf and can't find any information about a similar functionality. I know that Thymeleaf uses localized message bundles to fill in th:text elements, but can it load localized versions of the template files?
Note: I'm using Spring Boot