Re: XML properties files - brainstorm

Posted by Adrian Crum on
URL: http://ofbiz.116.s1.nabble.com/XML-properties-files-brainstorm-tp185922p185926.html

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