Re: XML properties files - brainstorm

Posted by Vinicius Miana on
URL: http://ofbiz.116.s1.nabble.com/XML-properties-files-brainstorm-tp185922p185940.html

Hi all,

I don't think having all the translations in one single file is a good idea:

1) If you do not want to have all translations on your system it is
easier to erase them
2) The person that speaks French is not necessarily the same that
speaks Chinese. With one
single file there will be more people working (committing/merging) the
same file.

Regarding the use of XML instead of properties, I think this is a good
thing and it is worth
taking a look at the apache commons configuration, which uses the Xml
properties API available in
Java 1.5 as well as database configurations and others:
http://commons.apache.org/configuration/

Cheers,

Vinny




On Nov 26, 2007 7:07 PM, Adrian Crum <[hidden email]> wrote:

> David E Jones wrote:
> >
> > This is interesting and might be a good starting point, but it doesn't
> > look like it helps with any of the stuff I mentioned in the email I
> > just barely sent.
> >
> > I'd rather use something that is more i18n oriented, and less name/
> > value pair (generic property) oriented.
> >
> > Maybe something like:
> >
> > <labels>
> >     <label key="foo.bar">
> >         <message xml:lang="en_US">American Foo Bar</message>
> >         <message xml:lang="en_GB">The Original Foo Bar</message>
> >         <message xml:lang="es">El Foo Bar en Español</message>
> >     </label>
> > </labels>
> >
> > In a separate file we'd have a default local, or perhaps even a  primary
> > and secondary default if no label is found in the primary  locale.
> >
> > -David
>
> That's a great suggestion. Keep in mind that existing properties files also contain configuration
> settings and system messages. With that in mind, how about something like:
>
> <resource>
>      <property key="foo.bar">
>          <value xml:lang="en_US">American Foo Bar</value>
>          <value xml:lang="en_GB">The Original Foo Bar</value>
>          <value xml:lang="es">El Foo Bar en Español</value>
>      </property>
>      <property key="io-error-message" value="IO error while running the Foo service"/>
>      <property key="foo.enabled" value="true"/>
> </resource>
>
> -Adrian
>
>
>