cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Engelhart <mengelh...@earthtrip.com>
Subject Re: ResourceBundles - was [RT] i18n
Date Mon, 12 Jun 2000 18:59:59 GMT
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>
> 
> That way, we have the ability to group the informaiton into some form
> of context.  It is simple, straight-forward, and provides a benefit over
> simple property files.
> 
> Once we have our XMLResourceBundle object, we can get the resource
> by id.  Something like this would be possible:
> 
> ResourceBundle res;
> res = XMLResourceFactory.getResourceBundle(String role);
> res.getString(String key);

I think I like this better too. Are you saying that each <group>'s id
attribute constitutes a separate ResourceBundle behind the scenes then?
So in your example, it would be like

String role = "uri";
ResourceBundle res = XMLResourceFactory.getResourceBundle(role);
res.getString("addUser");

Mike


Mime
View raw message