You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Peter Kröpfl <pe...@groebi.com> on 2004/06/02 00:51:51 UTC

i18n-key problem

sorry, 'bout the Mulitple...(2) - posting
hit post-button by accident...
------------------------------------------------



---
<a href=" snowboarder/start " class="textlink">
<i18n:text i18n:key=" page.category.snowboarder "> snowboarder </i18n:text>
</a>
---

With this code the i18n fails.
i guess the spaces before and after the i18n-key is are to blame for that.

I cannot figure out why these spaces appear.



Code Snips, that generate the code above:
---
<link>
 <xsp:attribute name="href">
  <esql:get-string column="NAME"/>/start
 </xsp:attribute>
 <xsp:attribute name="id">
  page.category.<esql:get-string column="NAME"/>
 </xsp:attribute>
 <esql:get-string column="NAME"/>
</link>
---

and


---
<xsl:template match="link">
 <a class="textlink" href="{@href}">
  <i18n:text i18n:key="{@id}"> <xsl:apply-templates/> </i18n:text>
 </a> 
</xsl:template>
---



ps: thanks to jörg and carlos :-)
as you can see i changed my code.
multiple attributes are possible now.

peter


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


Re: i18n-key problem

Posted by Joerg Heinicke <jo...@gmx.de>.
On 02.06.2004 00:51, Peter Kröpfl wrote:

> <a href=" snowboarder/start " class="textlink">
> <i18n:text i18n:key=" page.category.snowboarder "> snowboarder </i18n:text>
> </a>
> ---
> 
> With this code the i18n fails.

Ah, now I get confirmed what I already guessed :)

> i guess the spaces before and after the i18n-key is are to blame for that.

Indeed.

> I cannot figure out why these spaces appear.

That's simple:

 >  <xsp:attribute name="href">
 >   <esql:get-string column="NAME"/>/start
 >  </xsp:attribute>

Before the esql:get-string element you have a line break and spaces and 
the text node "/start" also does not end at the 't' but with a line 
break and the space(s) infront of </xsp:attribute>. You can either write 
it all in one line:

<xsp:attribute name="href"><esql:get-string 
column="NAME"/>/start</xsp:attribute>

or fix it in the stylesheet using normalize-space() that removes leading 
and trailing white spaces.

Joerg

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