I want to use Thymeleaf to localize the HTML of our Emails. Some of these Templates should use the same texts, which I want to store in a single set of .properties files.
So we have several Templates, say:
Each of them has their own .properties files (this works, with "Template-based message resolution"):
Additionally all mails contain some common texts like:
I don't wont to store these texts again in the email1_en.properties, email2_en.properties and so on.
But instead have one set of .properties files for common (but still localized) texts:
Which has the corresponding text:
footer.paragraph1: Some text...
For me this is exactly what should work with the "Origin-based message resolution" of the StandardMessageResolver (as described in the docs). Or shouldn't it? But I was not able to get it working.
Do you think my use case should work out of the box with Thymeleaf and "Origin-based message resolution"? If yes, could you elaborate where exactly the common_xx.properties file have to go? Maybe I just put them in the wrong place. (I don't really understand what "classes being used as origin" means in the documentation of the StandardMessageResolver.)
Edit: I found out that the StandardMessageResolver skips the whole Step 2 because origin is null.)