Loading proeprteis according local

6 messages Options
Embed this post
Permalink
NewWay

Loading proeprteis according local

Reply Threaded More More options
Print post
Permalink
Hi,

I'm trying to understand if the ability to load bundled resources as described here goes without saying when I'm using PropertiesConfiguration

I would appreciate a reference to a place where this is explained

Thank you
Jörg Schaible

Re: Loading proeprteis according local

Reply Threaded More More options
Print post
Permalink
Hi,

NewWay wrote at Montag, 2. November 2009 13:38:

>
> Hi,
>
> I'm trying to understand if the ability to load bundled resources as
> described
>
http://java.sun.com/j2se/1.4.2/docs/api/java/util/PropertyResourceBundle.html
> here  goes without saying when I'm using
>
http://commons.apache.org/configuration/apidocs/org/apache/commons/configuration/PropertiesConfiguration.html
> PropertiesConfiguration
>
> I would appreciate a reference to a place where this is explained

I am not sure what you mean. Commons Configuration and ResourceBundles are
simply something different. Both can use Java property files for their
data - but that's all what they share.

- Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

NewWay

Re: Loading proeprteis according local

Reply Threaded More More options
Print post
Permalink
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.

- Noa
Oliver Heger-3

[configuration] Re: Loading proeprteis according local

Reply Threaded More More options
Print post
Permalink
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: [hidden email]
For additional commands, e-mail: [hidden email]

Ralph Goers

Re: [configuration] Re: Loading proeprteis according local

Reply Threaded More More options
Print post
Permalink
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: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Oliver Heger-3

Re: [configuration] Re: Loading proeprteis according local

Reply Threaded More More options
Print post
Permalink
Ralph Goers schrieb:

> 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

This sounds really cool. In the past there were some thoughts about
combining [configuration] with the [resources] project (which is now
dormant). However, this did not get any further.

Oliver

>
> 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: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]