cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From solprovi...@apache.org
Subject Re: Internationalization transformer (i18n). Translate attrbutes with parameters
Date Thu, 13 Mar 2008 19:37:30 GMT
On 3/13/08, Alexander Daniel <alexander.daniel@gmx.at> wrote:
> On 11.03.2008, at 08:45, Joan Pascual wrote:
>  > I'm using 18n translation in Cocoon 2.1.9.
>  >
>  > I want to translate an attribute value. We can do that using
>  > i18:attr attribute, but we have a message with params and we don't
>  > know how to translate it.
>  >
>  > It is possible to translate an attribute value using param
>  > substitution?
> According to [1] it is not possible. For a workaround you could place
>  the param substitution into an element and run a XSLT Transformer
>  after the i18n transformer in the pipeline which changes the element
>  to an attribute.
>  Sorry but I have no better idea, Alex
>  [1] http://cocoon.apache.org/2.1/userdocs/i18nTransformer.html

That page states that using param substitution with i18n attributes
does not work due to a bug in Xerces' Attributes.removeAttribute().
Two fixes are implied:
1. Upgrade to a version of Xerces without the bug.  (This may have
been done. No versions or dates are mentioned in the documentation;
how old is the warning?)
2. Fix i18nTransformer.  translateAtributes() initializes a copy with
the current attributes, then removes attributes before adding the
translated attribute.  Better would start with an empty Attributes and
then add the attributes either unmodified or translated excluding the
i18n:attr attribute.  Attributes.removeAttribute() is not necessary.

Please:
1.  Test now.  If it works, then the bug was fixed for Xerces-2.8.0
and does not affect you.
2. If not working, test using Cocoon-2.1.11 to see if the bug has
already been fixed with Xerxes-2.9.1.
3. If still not working, upgrade Xerces and try again.  (I am
confused.  The latest release is Xerces-2.9.0.  How is Cocoon-2.1.11
using an imaginary version?)
4. Report to us.  I will be developing code based on the
18nTransformer soon.  If the bug is still active, I will fix
i18ntransformer.translateAttributes() immediately in preparation for
my other work..

solprovider

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


Mime
View raw message