Search code examples
javainternationalizationlocale

Supplemental Resource Bundles


I currently have a Resource Bundle for all of the set items in my GUI. My application allows for the additions of new components (as in customized buttons (not new swing components)) [which can have localized texts].

What is the best way of including the localized texts for the user created buttons.

The existing buttons have their translations set in the respective resource bundle (inside of the deployed JAR).

s there an way to supplement external resource bundles with internal ones?

I realize that I can write a wrapper around the existing functionality to include this, but I was wondering if someone has solved this problem in a different manner.


Solution

  • In case of dynamic UI, I am afraid the only realistic option is to use the database. Of course nothing stops you from implementing ResourceBundle child class that would read resources from the database – you may achieve uniform way of accessing resources that way.

    And the database itself doesn't have to be resource-eating monster, you might want to use Apache Derby or H2.