From: "Marcus Crafter" <[EMAIL PROTECTED]>

> Hi Konstantin!

Hi mate!

Haven't read your for ages. ;)

>
> On Tue, Nov 12, 2002 at 06:46:08PM +0300, Konstantin Piroumian wrote:
> >
> > 1. New features - new namespace.
> >
> > The new implementation of i18n transformer has several very useful new
> > features but also some backward incompatibilities, so I am going to
change
> > the namespace to use a new version number (2.1 instead of 2.0).
>
> Great stuff mate. What new features are available ?
> Is this a complete rewrite ? or an adaption of the old one ?
> What's not compatible with the older one ?

Thanks to Matthieu Sozeau (mattam at netcourrier dot com) it is now
possible:

1. To have markup in translations and parameters which is very useful for
things like links, e.g.:

<i18n:translate>
    <a href=http://www.any.com>{0}</a>
    <i18n:param><i18n:text>Any</i18n:text></i18n:param>
</i18n:translate>

This feature also allows to switch on the XPath translation keys (they are
now hardcoded to '/catalogue/message[@key=$key]/text()'. It can be useful to
select XML fragments to initialize selection lists etc.

2. 'inline translations':

<i18n:if locale="ru">Only for Russian language, including ru_RU,
ru_RU_KOI8r</i18n:if>

and

<i18n:choose>
  <i18n:when locale="de_AT">Only for Austria</i18n:when>
  <i18n:otherwise>For others</i18n:otherwise>
</i18n:choose>

3. Also, now possible to have named parameters:

<i18n:translate>
        {one}, {two}
        <i18n:param name="one"><i18n:text>one</i18n:text></i18n:param>
        <i18n:param name="two"><i18n:text>two</i18n:text></i18n:param>
</i18n:translate>

The implementation is adaption of the old one, but there are some other new
things in the i18n package: Bundle and BundleFactory interfaces, and
rewritten XMLResourceBundle implementation, etc. (It'd be fine if some
avalonian could take a look at them and comment).

Incompatibilities are not many, AFAIK, it is the <i18n:param> syntax: it
became more verbose and you should now use:
<i18n:param><i18n:date /></i18n:param> instead of <i18n:param type="date"/>.
Another changed thing is the <i18n:text> inside of the <i18n:translate>: it
is now required to use i18n:key attribute instead of the inline text.
Though, I think that this one can be made less verbose by implementing this
syntax:

<i18n:translate key="text_with_params">
        <i18n:param name="one"><i18n:text>one</i18n:text></i18n:param>
        <i18n:param name="two"><i18n:text>two</i18n:text></i18n:param>
</i18n:translate>

>
> <snip/>..
>
> > So, the second questions is: is it a good idea to use a configuration
> > parameter to control the cachability of a component? Or there are better
> > solutions from Avalon/Excalibur for such cases?
>
> Michael might have some ideas about how to do this with pipeline
> hints ? hmm.. I'll ask him.

Thanks.

>
> Looking forward to seeing what you've written Konstantin :)

I didn't wrote much, again thanks to Matthieu, who did the most of the
markup processing changes.

Btw, now it'd be possible to implement your suggested <i18n:to-upper /> and
<i18n:to-lower /> tags to be used in parameters to perform Upper/Lower case
conversions.

Regards,
  Konstantin

P.S. The BASF IT developers suggested to rewrite the i18n transformer using
their Tag (JSP-like) transformer and it seems to be a more flexible
approach, but unfortunately, I didn't have time to spend on investigating
it. I think that in their implementation it's much easier to add new tags.

P.P.S. I have new translations for i18n samples in Japanese, Chinese and
Korean!!! They look excelent! ;)

>
> Cheers,
>
> Marcus
>
> --
>         .....
>      ,,$$$$$$$$$,      Marcus Crafter
>     ;$'      '$$$$:    Computer Systems Engineer
>     $:         $$$$:   ManageSoft GmbH
>      $       o_)$$$:   82-84 Mainzer Landstrasse
>      ;$,    _/\ &&:'   60327 Frankfurt Germany
>        '     /( &&&
>            \_&&&&'
>           &&&&.
>     &&&&&&&:
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>
>


------------------
Get free mailbox 20 Mb at http://www.hotbox.ru

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

Reply via email to