-
Notifications
You must be signed in to change notification settings - Fork 951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resourcebundle basenames order not respected #11795
Comments
PR follows. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps to Reproduce
Define the PluginAwareResourceBundleMessageSource in resources.groovy and set the basenames array.
Expected Behaviour
Grails respects the order of basenames defined, so one is able to overwrite existing keys with new ones in a separate bundle.
This is especially useful if you migrate a project with thousands of translations in many languages and need to re-define key texts. For this, you use a basename which is defined first in the list.
Of course you can play around with bundle naming, as this is the default behaviour of the PluginAwareResourceBundleMessageSource, but the AbstractMessageSource.setBasenames() doc says:
"The associated resource bundles will be checked sequentially when resolving a message code".
Also, Spring ReloadableResourceBundle uses a similar functionality.
Actual Behaviour
Grails ignores the basenames order, so you cannot overwrite bundle keys in bundles you defined to be resolved first.
Environment Information
Example Application
https://github.com/robertoschwald/GrailsPluginAwareBasenamesOrderBug
The text was updated successfully, but these errors were encountered: