From: "Peter Royal" <[EMAIL PROTECTED]>

> On Wednesday 22 May 2002 03:24 am, Konstantin Piroumian wrote:
> > Btw, I don't think that replacing XMLResourceBundle with a HashMap will
> > improve perfomance much in the long run, because the values are stored
in a
> > HashMap on the first use, so there should be no much difference.
>
> Agreeed. One of our main problems was the first use though. In development
it
> would take a minute or two to fully translate our menu file (large
> chunk-o-javascript) with the XMLResourceBundle based approach. While some
of
> the abstractions of the XMLResourceBundle are nice, it isn't really
> neccessary to parse an XPath each time a value is retrieved.

As I've said, really cool abstractions (a Bundle and not XMLResourceBundle)
were never been finalized and remained in Avalon scratchpad.
XMLResourceBundle is used in a little unusual way now: it behaves just like
an XML property file, while it could provide an XML content using XPath
expressions and not the current hard-coded one.

>
> I parse the i18n dictionaries at startup and store the key/values in an
> unsynchronized hashmap and the transformer flies now.

Did you use the 'cache-at-startup' configuration parameter? I was sure that
it was for exactly the same thing, though my information can be our of date,
hadn't a look at it for a long time. Also, I can remember some Hashtables
there, they should be replaced by HashMaps too.

>
> Perhaps we can abstract out an interface for the I18nTransformer to talk
to a
> catalogue/dictionary source so the XMLResourceBundle usage is optional?
I'd
> love for my changes to the I18nTransformer to be able to make it back to
the
> main trunk.

Yes, that would be fine! I think that the best thing would be to separate
dictionary handling from the transformer at all and use either a custom
source, say: <transform src="i18n:db:/catalogue/messages" /> or <transform
src="i18n:xml:/catalogue/messages" />, or configure it like an SQL
connection and use a short name of it for the transformer
configuration/parameterization:
<transformer ...>
    <bundle-factory>xml</bundle-factory>
</transformer>

or something like that.

What do you think? I'd also recommend you to look at the i18n stuff in the
Avalon scratchpad.

Konstantin

P.S. Unfortunately, I can help only with comments/suggestions for now
because of (as usual) a limited time.

> -pete
>
>
> --
> peter royal -> [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail: <[EMAIL PROTECTED]>
>

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to