We have a product that runs in a web environment which should allow customers to translate the bundle entries at runtime and the changes to be picked up without re-deployment. We successfully achieve the goal of translating the resources through using ListResourceBundle implementation, but the problem is we can't offer the customers the ability to add a new language (new Locale). Currently we need the physical resource bundle java, in order for the users to start translating text at runtime.
Does anybody know any solution that will allow us to register new Bundles dynamically?
Thank you for your answer, as I was mentioning on my initial post, we are already using ListResourceBundle implementations.
The problem is that we have one ListResourceBundle file for each language, eg:
So, when we need to add a new language, Spanish for example, we would need to create one more physical file.
My question: is it any way to handle all 3 languages from a single java file only?
Rather buried in the docs but the following method
Documents the parameter as follows
baseName - the base name of the resource bundle, a fully qualified class name
You then nee a class that resolves any calls to the database. I suspect however that you are actually going to end up using the explicit classloader version of the class since it might attempt to add the language extension to the class name (just guessing) and if that is the case then a custom class loader could be used to return (maybe) a single class with some construction semantics or a proxy.
At any rate the final class would resolve to a database call.