On 28.05.2004 13:25, Marcus Rau wrote:

Hello,

I'm working on a webapplication based upon Cocoon 2.0.1 (in combination with a JDK 1.3.0 from IBM and Tomcat 4.0.4 under Win 2000). Recently I encountered an uncomprehensible (for me!) problem with the i18n-Transformer. Translation keys from the i18n-catalogues can't be found though they are existing. As result there are loads of "untranslated texts" into my pages.

Has anybody been confronted with (or heard of) similar issues? I'm thankful for any hint.

For those with a vast patience I'm trying to be more precise:

There's an XSP-Page producing the following XML-Output:

<snip what="xsp code"/>

Using the XSLT-Transformer, this output is cast into an HTML-Skeleton:

<snip what="xslt code"/>

So far, the preparation of the HTML-Page isn't finished yet. As you can see the HTML still contains three <i18:text>-Elements. That's where the story is getting tricky. The substitution of these entries using the "org.apache.cocoon.transformation.I18nTransformer" (see the excerpt from sitemap.xmap below) fails. Apparently the Transformer does its job. It evaluates and substitutes the i18n-Tags, but the first two keys (RESULTPAGE_TITLE_EDIT_DOCUMENT and NO_CHANGES) are supposed to be absent in the translation catalogues. As you may guess: THEY ARE DEFINITELY NOT MISSING! Wrong spelling of the key names can also be disregarded. The last key (DOCDETAIL_LINK) is treated without problems.

From the appropriate sitemap.xmap:

<snip what="sitemap"/>

One thing has to be mentioned: The "faulty keys" are generated dynamically (as Strings) in the XSP-Page and thrown into HTML by <xsl:value-of select="">, whilst the "good one" is hard coded in the XSL-stylesheet (see below). The phenomenon occurs independent of the concrete key names produced by the XSP.

All your code looks ok. I don't know how buggy the i18n element recognition was, but changing your stylesheet a bit might help. And you are probably also using a very old version of Xalan which might also cause problems. I think it is something with the SAX events, maybe additional white spaces.


<i18n:text><xsl:value-of select="/document/pagetitle" /></i18n:text>

I don't know if i18n in Cocoon 2.0.1 can handle this, but putting the key into an attribute "key" works at least in recent Cocoon versions:


<i18n:text key="{/document/pagetitle}"/>

Also enforcing casting to string might help:

<i18n:text><xsl:value-of select="string(/document/pagetitle)" /></i18n:text>

or even better:

<i18n:text><xsl:value-of select="normalize-space(/document/pagetitle)" /></i18n:text>

Joerg

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



Reply via email to