I reply only to Simone. My mistake.
----- Forwarded message from [EMAIL PROTECTED] -----
Date: Mon, 13 Mar 2006 14:34:53 +0100
From: [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
Subject: Re: i18n transformer doesn't translates attributes
To: Simone Gianni <[EMAIL PROTECTED]>
Quoting Simone Gianni <[EMAIL PROTECTED]>:
Ciao Alberto,
it should work correctly, but before further investigations, are you
i18n cocoon sample works correctly, of course.
sure about the following :
- i18n namespace is correctly declared in a node parent of the <area> element
<?xml version="1.0" encoding="ISO-8859-1"?>
<page xmlns:xsp="http://apache.org/xsp"
xmlns:xspdoc="http://apache.org/cocoon/XSPDoc/v1"
xmlns:esql="http://apache.org/cocoon/SQL/v2"
xmlns:i18n="http://apache.org/cocoon/i18n/2.1" type="homepage">
<heading/>
<body>
<main>
<area id="1" nome="about_area" colour="FF0000" label="about_area"
i18n:attr="label">
<menu id="1" name="about" image="about.jpg">
<item id="1" name="whoweare">
<label><i18n:text>whoweare</i18n:text></label>
<link>whoweare</link>
</item>
...
I suppose namespace declaration is correct (i18n:text tags work).
- there is a <message key="about_area">something</message> in your
i18n bundle
The first thing I checked.
There's only one catalogue.
- the <area> element makes it thru the i18n transformer (no xsl before
the i18n transformer that could alter the area element)
could you post the sitemap fragment and some more xml lines?
...
<map:transformers default="xslt">
...
<map:transformer name="i18n"
src="org.apache.cocoon.transformation.I18nTransformer"
logger="sitemap.transformer.i18n">
<catalogues default="messages">
<catalogue name="messages" id="messages"
location="cocoon:/translations"/>
</catalogues>
</map:transformer>
</map:transformers>
...
<map:match pattern="homepage">
<map:generate type="serverpages"
src="resources/buildhomepage.xsp" label="source">
<map:parameter name="table" value="areas"/>
<map:parameter name="orderfields" value="pos"/>
</map:generate>
<map:transform type="i18n" label="translated">
<map:parameter name="locale" value="{locale}"/>
</map:transform>
<map:transform type="xslt"
src="stylesheets/homepage2html.xsl" label="middle"/>
<map:serialize type="html"/>
</map:match>
The output of "cocoon:/translations/messages(_en).xml" is the following
<catalogue xml:lang="en">
<message key="about_area">something</message>
<message key="data_area">something</message>
...
</catalogue>
Follow a fragment of xsp code that generate xml:
<xsp:page
language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:esql="http://apache.org/cocoon/SQL/v2"
xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
space="strip">
...
<xsp:element name="area">
<xsp:attribute name="id"><esql:get-int column="pos" /></xsp:attribute>
<xsp:attribute name="name"><esql:get-string column="name"
/></xsp:attribute>
<xsp:attribute name="colour"><esql:get-string column="colour"
/></xsp:attribute>
<xsp:attribute name="label"><esql:get-string
column="name"/></xsp:attribute>
<xsp:attribute name="i18n:attr">label</xsp:attribute>
...
thanks
Simone
[EMAIL PROTECTED] wrote:
I have a strange problem.
Out of a generator i have the following tag
...
<area id="1" name="about_area" colour="FF0000" label="about_area"
i18n:attr="label">
...
After an i18n transformer, all "<i18n:text>" tags are correctly
translated but the tag above is unchanged and the attribute "label"
is untranslated.
Any suggest?
Alberto Brosich
Cocoon 2.1.8
Jetty
Linux Debian 3.1
Kernel 2.6.15
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Simone Gianni
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
----- End forwarded message -----
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]