cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From giacomo <giac...@apache.org>
Subject Re: I18nTransformer (with param substitution)
Date Mon, 14 May 2001 09:04:24 GMT

Konstantin

Can anybody work on this patch? I haven't had the time to look into it.

Giacomo

> Hi!
>
> I've implemented the param substitution in I18nTransformer. Now it is
> possible to use it like this:
> <i18n:translate>
>     <i18n:text>This page was hit {0} times.{/i18n:text>
>     <i18n:param><xsp:expr>count</xsp:expr></i18n:param>
> </i18n:translate>
> The source and samples are attached. I have also attached an XML Spy project
> file  for convenience.
>
> I am open for comments and suggestions. Next task will be dictionary
> improvement to support include and import capabilities.
>
> Btw, is there a good way of internationalizing dates and currencies (to use
> different formatting)?
> Example:
> <i18n:translate>
>     <i18n:text>Current date {0, date, 'dd/MM/yyy'}.{/i18n:text> <!-- this
is
> stored in the dictionary -->
>     <i18n:param><xsp:expr>new Date()</xsp:expr></i18n:param>
> </i18n:translate>
>
> The problem is that MessageFormat class that I use for substitution gets an
> array of Objects as argument, but I cannot get objects from XML - only
> strings. Any ideas?
>
> Best regards,
>
> Konstantin Piroumian
> Software engineer
>
> Protek Flagship LLC
> Phone: + 7 095 795 0520 (add. 1288)
> Fax: + 7 095 795 0525
> E-mail: kpiroumian@flagship.ru
> http://www.protek.com
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message