cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <>
Subject Re: i18n catalogues and caching
Date Fri, 14 Jan 2005 13:11:38 GMT
Reinhard Poetz <reinhard <at>> writes:

> > <map:transformer logger="sitemap.transformer.i18n.todo" name="i18n"
> >                  src="org.apache.cocoon.transformation.I18nTransformer">
> >   <catalogues default="dictionary">
> >     <catalogue id="dictionary" location="resources/translations"
> >                name="dictionary"/>
> >       <catalogue id="todo" name="todo">
> >         <location>../resources/translations</location>
> >         <location>resources/translations</location>
> >         <location>{request-attr:group}/resources/translations</location>
> >       </catalogue>
> >     <catalogue id="page" location="../resources/translations" name="page"/>
> >   </catalogues>
> >   <cache-at-startup>false</cache-at-startup>
> > </map:transformer>
> > 
> > Any further idea?
> Not a specif one. I'd use the debugger or add some logging statements to find 
> out where the I18nTransformer is actually looking for the catalogues.

Did it and found the reason - and a work around. It's not I18nTransformer's
fault, but the one of XMLResourceBundleFactory: It's creating a hierarchy of
XMLResourceBundle's, which have a parent relation to another XMLResourceBundle.
The bundles are cached by filenames, with the declaration like above it's
"../resources/translations". So independent on the latter locations always the
cached bundle for the first location is returned. The work around is obviously
to change the order of the locations from the specific to the common one.
But it's still a strange behaviour, the hierarchy is not obvious for the user,
it's more a list of locations. Therefore the current behaviour and the
workaround should not only be well-documented, but also changed.


View raw message