commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mattias J <mjsl...@expertsystem.se>
Subject Re: [Resources] RFE: Support for multiple Locales in Messages.getMessage
Date Thu, 12 May 2005 07:07:47 GMT
At 2005-05-11 23:47, you wrote:
>Currently the Messages.getMessage methods only support a single Locale.
>  So if you had an application that provided English (default) and French
>resources and a user preferred to read German, French, and English (in
>that order), a call to Messages.getMessage(<German>, <key>) would return
>the message from the English resource when the message from the French
>resource would be preferable.
>
>This RFE calls for the Messages.getMessage methods to accept an array of
>Locales where they currently accept a single Locale.  The implementation
>would then search for the specified key in each of the resources for the
>specified Locales in element order.

I don't even think this is possible, since Commons Resources (AFAIK) uses 
java.utils.ResourceBundle for one of its implementations, and 
ResourceBundle returns the resouce for the default locale, if the requested 
locale is not found. There would therefore be no way for Commons Resources 
to know whether the resource was found using the primary locale or the 
default locale, and would therefore not be able to tell when the secondary 
locale should be used.

   / Mattias J 


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


Mime
View raw message