I'm developing a shared library containing some UI components for Spring (Boot) applications.
I want the library to contains the translations for the text of its own components.
My idea was to create a ResourceBundleMessageSource in the library, along with the message properties files containing the translations.
I create the message source like this:
this.localMessageSource = new ResourceBundleMessageSource();
localMessageSource.setDefaultEncoding("UTF-8");
localMessageSource.setBasename("mymessages"); // I have also tried "classpath:mymessages"
And I have tried putting the mymessages.properties, mymessages_nl.properties etc. files in /src/main/resources and in /src/main/resources/META-INF, but when calling the code that accesses this MessageSource to get the messages, they are not found. In the debugger, I can see that the resource bundle is not found at all.
What do I need to change to make this work?