Skip to content

resourcebundle basenames order not respected #11795

Closed

Description

@robertoschwald

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

  • Operating System: Doesn't matter. macOS 11 in this case
  • Grails Version: Grails 3 and 4 affected
  • JDK Version: 8 or 11
  • Container Version (If Applicable): Doesn't matter.

Example Application

https://github.com/robertoschwald/GrailsPluginAwareBasenamesOrderBug

Activity

  1. robertoschwald commented on May 2, 2021

    @robertoschwald
    ContributorAuthor

    PR follows.

  2. added a commit that references this issue on May 17, 2025
  3. added this to the grails:7.0.0 milestone on Jul 16, 2025
  4. jamesfredley commented on Aug 18, 2025

    @jamesfredley
    Contributor
  5. removed this from the grails:7.0.0-RC2 milestone on Aug 20, 2025
  6. added 2 commits that reference this issue on Jul 17, 2026
  7. added 2 commits that reference this issue on Sep 30, 2026
    c550059
    a37a97e
  8. added this to the grails:7.0.18 milestone on Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions