You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Alan Menant <al...@gmail.com> on 2007/08/07 11:00:11 UTC
Many i18n transformations in sitemap
Hello,
I was looking for a way to apply many i18n transforms in a pipeline.
Here is my catalog definition :
<map:transformer name="i18n" src="
org.apache.cocoon.transformation.I18nTransformer" logger="sitemap.i18n">
<catalogues default="keyin">
<catalogue id="login" name="login" location="i18n" />
<catalogue id="keyin" name="keyin" location="i18n" />
<catalogue id="search" name="search" location="i18n" />
<catalogue id="buttons" name="buttons" location="i18n"
/>
<catalogue id="home" name="home" location="i18n" />
</catalogues>
<untranslated-text>untranslated text</untranslated-text>
<cache-at-startup>true</cache-at-startup>
</map:transformer>
On my home page, I need to internationalize elements that are in both home
and buttons catalogs. I tried may ways to do this :
<map:match pattern="home">
<map:generate type="jx" src="pages/home.jx"/>
<map:transform src="stylesheet/layout.xsl" />
<map:transform type="i18n" />
<map:serialize type="html"/>
</map:match>
But each time, I get either buttons or home elements traducted (from only
one catalog).
Is it possible to apply two or more i18n transformations in a match ? Maybe
by specifying explicitely which catalog to use ?
Alan
Re: Many i18n transformations in sitemap
Posted by Alan Menant <al...@gmail.com>.
2007/8/7, Jason Johnston <co...@lojjic.net>:
>
> On Tue, 7 Aug 2007 11:00:11 +0200, "Alan Menant" <al...@gmail.com>
> wrote:
> > Hello,
> > I was looking for a way to apply many i18n transforms in a pipeline.
> >
> > Here is my catalog definition :
> ...
> > On my home page, I need to internationalize elements that are in both
> home
> > and buttons catalogs. I tried may ways to do this :
> ...
> > But each time, I get either buttons or home elements traducted (from
> only
> > one catalog).
> > Is it possible to apply two or more i18n transformations in a match ?
> > Maybe by specifying explicitely which catalog to use ?
>
> Yes, you can specify which catalogue should be used to translate each i18n
> key:
>
> <i18n:text i18n:catalogue="home">key.from.home</i18n:text>
> <i18n:text i18n:catalogue="buttons">key.from.buttons</i18n:text>
>
> ...or if using attribute translation:
>
> <someelement someattr="home:key.from.home" i18n:attr="someattr" />
> <someelement someattr="buttons:key.from.buttons" i18n:attr="someattr" />
>
> See the I18nTransformer documentation also since it covers this:
> http://cocoon.apache.org/2.1/userdocs/i18nTransformer.html
>
> --Jason
Ok thanks again Jason.
Alan
---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
Re: Many i18n transformations in sitemap
Posted by Jason Johnston <co...@lojjic.net>.
On Tue, 7 Aug 2007 11:00:11 +0200, "Alan Menant" <al...@gmail.com>
wrote:
> Hello,
> I was looking for a way to apply many i18n transforms in a pipeline.
>
> Here is my catalog definition :
...
> On my home page, I need to internationalize elements that are in both
home
> and buttons catalogs. I tried may ways to do this :
...
> But each time, I get either buttons or home elements traducted (from only
> one catalog).
> Is it possible to apply two or more i18n transformations in a match ?
> Maybe by specifying explicitely which catalog to use ?
Yes, you can specify which catalogue should be used to translate each i18n
key:
<i18n:text i18n:catalogue="home">key.from.home</i18n:text>
<i18n:text i18n:catalogue="buttons">key.from.buttons</i18n:text>
...or if using attribute translation:
<someelement someattr="home:key.from.home" i18n:attr="someattr" />
<someelement someattr="buttons:key.from.buttons" i18n:attr="someattr" />
See the I18nTransformer documentation also since it covers this:
http://cocoon.apache.org/2.1/userdocs/i18nTransformer.html
--Jason
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org