cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject Re: ResourceBundles - was [RT] i18n
Date Tue, 20 Jun 2000 20:36:18 GMT
Neeme Praks wrote:
> 
> > -----Original Message-----
> > From: Mike Engelhart [mailto:mengelhart@earthtrip.com]
> > Sent: Monday, June 12, 2000 9:00 PM
> >
> > on 6/12/00 11:43 AM, Berin Loritsch at
> > bloritsch@infoplanning.com wrote:
> >
> > > <?xml version="1.0"?>
> > > <resource xml:lang="en">
> > > <group id="error">
> > > <value id="500">Internal Server Error</value>
> > > <value id="404">Page not found</value>
> > > </group>
> > > <group id="uri">
> > > <value id="addUser">user/add</value>
> > > <value id="killUser">user/obliterate</value>
> > > </group>
> > > <group id="form">
> > > <value id="userName">Enter the user's name here</value>
> > > </group>
> > > </resource>
> 
> [snip]
> 
> > So in your example, it would be like
> >
> > String role = "uri";
> > ResourceBundle res = XMLResourceFactory.getResourceBundle(role);
> > res.getString("addUser");
> 
> I started to implement something like this for myself and came across
> following question: would it be possible to nest groups and then address
> them using a path?
> 
> So, instead of this:
> 
> <resources xml:lang="en">
>   <group name="forms">
>     <resource name="contacts-search-searchfor-desc">find:</resource>
>     <resource
> name="contacts-search-field-to-search-desc">what:</resource>
>     <resource name="contacts-search-from-desc">where:</resource>
>     <resource name="contacts-search-from-mycontacts-desc">my
> contacts</resource>
>     <resource name="contacts-search-from-allmembers-desc">all
> members</resource>
> 
>     <resource name="contacts-search-field-to-search-all">all</resource>
>     <resource name="contacts-search-field-to-search-firstname">first
> name</resource>
>     <resource name="contacts-search-field-to-search-lastname">last
> name</resource>
>     <resource
> name="contacts-search-field-to-search-phone">phone</resource>
>     <resource
> name="contacts-search-field-to-search-email">e-mail</resource>
> 
>     <resource name="contacts-search-submit">Search</resource>
>   </group>
> </resources>
> 
> something like this:
> 
> <resources xml:lang="en">
>   <group name="forms">
>           <group name="contacts-search">
>                   <group name="desc">
>                     <resource name="searchfor">find:</resource>
>                     <resource name="field-to-search">what:</resource>
>                     <resource name="from">where:</resource>
>                     <resource name="from-mycontacts">my
> contacts</resource>
>                     <resource name="from-allmembers">all
> members</resource>
>                   </group>
> 
>                   <group name="input">
>                           <group name="field-to-search">
>                             <resource name="all">all</resource>
>                             <resource name="firstname">first
> name</resource>
>                             <resource name="lastname">last
> name</resource>
>                             <resource name="phone">phone</resource>
>                             <resource name="email">e-mail</resource>
>                           </group>
>                     <resource name="submit">Search</resource>
>                   </group>
>           </group>
>   </group>
> </resources>
> 
> And then I could address then like:
> 
> String role = "forms/contacts-search/desc";
> ResourceBundle res = XMLResourceFactory.getResourceBundle(role);
> res.getString("searchfor");
> 
> Is this reasonable?

keep going.... add XPath and what you need is an XML database :)

No, seriously, the pattern is clear: your resource bundles are "just
another structured content". While your role is "just a simpler xpath
alternative".

It's _obvious_ we need something like that in almost _every_ case...
flat properties files are not enough anymore and relational tables are
somewhat too complex for these things. Tree structures are something in
between.

To be entirely honest, I don't have enough competence to talk about
DBMS, query languages and how to design an XML database, this is part of
the reason why I'd love the Infogroup people joining efforts with us and
separate structure content management in a totally separate project.

True, resource bundles are very specific and don't require revisioning
not transactions... but still the interface model Neeme outlines is so
similar to the one I vision for a more general structured content
management system....

well, anyway, let's finish the sitemap first...

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<stefano@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------



Mime
View raw message