I have been considering either adding something to commons
configuration, but more probably creating a new project to do this (or
repurposing commons i18n).
The idea is that you want to have XML files that contain
internationalized message text. XML because it has a proper way of
specifying the encoding. But it would probably use the
java.util.Properties XML schema. Then you would have a combined
configuration that aggregates the files together in the manner
described in the ResourceBundle javadoc. In my case, I also need to
add in another factor - allowing the localized files to be overridden
per "business client" for multi-tenant support. Ideally, this
framework should then be able to be plugged in underneath Spring's
MessageSource API, Struts' MessageResources API or even the Java 6
ResourceBundle.Control. Of course, it should also be able to be used
directly.
Basic localization can be done today in 1.7-SNAPSHOT with
DefaultConfigurationBuilder, DynamicCombinedConfiguration and a set of
MultiFileHierarhicalConfigurations. Just make sure that the pattern
specified in the DynamicCombinedConfiguration and
MultiFileHierarchicalConfigurations contains the variable for the
locale. All the framework I am proposing would do would be to wrap
this in a standard way and provide a suitable API.
Ralph
On Nov 4, 2009, at 12:33 PM, Oliver Heger wrote:
First, please note that this is a shared list. So it is convention
to prefix the subject with the name of the component you are
interested in as I have done now.
Answer below...
NewWay schrieb:
I mean that i want to be able to use the services available to me
in the
commons-configuration
but that the file that I'm using will be retrieved through the Bundle
mechanism so i can get it in different locals.
Sorry, I still do not fully get it. Maybe you can elaborate a bit
more on your concrete use case?
Commons Configuration does not have a Configuration implementation
on top of a resource bundle if it is this what you mean. There is no
out-of-the-box way to obtain configuration properties for different
locales.
Oliver
- Noa
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]