cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Torsten Curdt" <>
Subject RE: [RTl] i18n transformer
Date Sat, 27 Oct 2001 13:10:00 GMT
> At 02:39 PM 10/25/2001 +0200, you wrote:
> >  b)Maybe a bit nicer sollution could be to have an
> >
> >     interface I18nDictonary {
> >        public String lookup( String key );
> >        public long getLastModified();
> >     }
> >
> >    A helper class could delegate the lookup to the original
> >    XMLResourceBundle. If the getLastModified() is available
> >    making the I18nTransformer cacheable should be really easy,
> >    too. Cacheability would only depend on the features of
> >    the dictonary then.
> I've already implemented something like that locally here, I just haven't 
> had a chance to port it back to the C2 tree and send a patch. Looks like 
> its needed tho :)
> What I did:
> I made an I18nResourceFactory component that returns XMLResourceBundles's :
> XMLResourceBundle select(String name, Locale locale) throws ComponentException;

Hm.. on the first glance this looks more like a DictionarySelector/Factory to me.
(Did I get this wrong?) But there is already a XMLResourceBundleFactory
used in the current i18n transformer implementation.

What I'd like to see is to decouple the i18n transformer from the
XMLResourceBundle. I'd like to introduce an interface meaning "provides i18n lookups".
So the XMLResourceBundle would need to implement this interface (or better
a delegation should do so). It should be quite easy to support other resources
(like e.g. a SQL database) by creating some Components implementing this
interface then.

To unsubscribe, e-mail:
For additional commands, email:

View raw message