Commons configuration is not designed to replace the ResourceBundle class, you may want to look at commons resources instead:
http://jakarta.apache.org/commons/resources/
Emmanuel Bourg
Randy Phillips wrote:
Hi Emmanuel, Yes I have looked at this. The conflict, as I see it, is that within a particular Configuration object, built on a number of properties files, makes no distinction between the individual properties file and the name/value pairs within them.
Using i18n, the individual properties files represent different Locales while the names within remain the same and their values represent the Locale specific "translation".
If I understand how the Configuration object works,
the "conf.xml" file contains a list of properties
files but only the name/value pairs of the "top-most"
properties are used to resolve a "getString(<name>)".
In an i18n scenario this cannot work as individual properties (Locale specific) must be addressed.
Thanks for your interest,
Randy Phillips
--- Emmanuel Bourg <[EMAIL PROTECTED]> wrote:
Did you try to solve this issue with the standard PropertyResourceBundle ?
http://java.sun.com/j2se/1.5/docs/api/java/util/PropertyResourceBundle.html
Emmanuel Bourg
Randy Phillips wrote:
Sure...
The text of page (or set of pages) is supported
via a
properties file. Each language supported is
represented via it's own properties file.
As an example... I have two pages named page1 and page2. I support
3
languages, Canadian English, Canadian French and Spanish.
I support these pages and their respective
languages
using three properites files:
page1_en_CA.properties,
page1_fr_CA.properties and
page1_es_ES.properties as well as page2_en_CA.properties,
page2_fr_CA.properties and
page2_es_ES.properties.
Within these files the "Welcome" title would look
like
this:
In page1_en_CA.properties welcome.title=Welcome to the Application!
In page1_fr_CA.properties welcome.title=Bienvenue � l'application!
In page1_es_ES.properties welcome.title=Recepci�n al uso!
So based on the users selected Locale (i.e.
English,
French or Spanish) the appropriate properties file
is
referenced and the value of "welcome.title" is displayed in the appropriate language.
Although I haven't delved deeply into the issue,
at
this point the only alternative I see is to
create
multiple Configuration objects, each on
representing a
particular Locale.
However, I'm not convinced this is the best
solution.
Again, I appreciate any insight you can provide to
my
dilema.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
______________________________________________________________________ Post your free ad now! http://personals.yahoo.ca
--------------------------------------------------------------------- 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]
