You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by NewWay <no...@gmail.com> on 2009/11/02 13:38:51 UTC

Loading proeprteis according local

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

Thank you
-- 
View this message in context: http://old.nabble.com/Loading-proeprteis-according-local-tp26156700p26156700.html
Sent from the Commons - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [configuration] Re: Loading proeprteis according local

Posted by Oliver Heger <ol...@oliver-heger.de>.
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: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [configuration] Re: Loading proeprteis according local

Posted by Ralph Goers <ra...@dslextreme.com>.
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: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


[configuration] Re: Loading proeprteis according local

Posted by Oliver Heger <ol...@oliver-heger.de>.
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: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: Loading proeprteis according local

Posted by NewWay <no...@gmail.com>.
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

-- 
View this message in context: http://old.nabble.com/Loading-proeprteis-according-local-tp26156700p26194973.html
Sent from the Commons - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: Loading proeprteis according local

Posted by Jörg Schaible <jo...@gmx.de>.
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: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org