cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joost Kuif" <Joost.k...@mobillion.nl>
Subject general.field-required translation not working
Date Wed, 18 Jan 2006 09:07:25 GMT
Hi,

I'm using cforms and trying to override the general.field-required
message for the empty but 'required' (in formdefinition) fields. 
I have the line below in a messages.xml:

<message key="general.field-required">Dit is een verplicht
veld.</message>

For testing purposes: If i specify this key in a label of a field, the
string "Dit is een veplicht veld" is correctly translated for this
field-label. So cocoon is able to find the needed key in my messages.xml
with the keys i specify in the formdefinition. 

Only the translation for required="true" in the <fd:field> tag is NOT
translated into a proper message if a user leaves a (required) field
empty.
 
AFAIK this should be handled somewhere in the forms*.xsl pages.
Unfortunalely i cannot find the problem. Can someone help me? Thanks a
lot!


Joost.


Example:
The code below works, the specified label is overruled by the one in my
messages.xml:

<fd:label>
<i18n:text i18n:key="general.field-required">this should be
overruled</i18n:text>
</fd:label>



The sitemap for my form is:

<map:match pattern="registerform">
  <map:generate type="file" src="pgRegister.xml"/>
  <map:transform type="i18n">
    <map:parameter name="locale" value="nl_NL"/>
  </map:transform>
  <map:transform src="pgRegister.xsl">
  <map:parameter name="css" value="{session-attr:css}" />
  </map:transform>
  <!-- For the field required translation? -->
  <map:transform type="i18n">
    <map:parameter name="locale" value="nl_NL"/>
  </map:transform>
  <map:serialize type="xhtml"/>
</map:match>



The pgRegister.xsl has got some includes (it re-uses components used in
the site):
----------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="2.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:i18n="http://apache.org/cocoon/i18n/2.1">


                
  <xsl:include
href="blogContext:/xsltVlekken/vkPortal_header_links.xsl"/>
  <xsl:include href="blogContext:/xsltVlekken/vkSiteStatistics.xsl"/>
  <xsl:include href="blogContext:/xsltVlekken/vkTab_menu.xsl"/>
  <xsl:include href="blogContext:/xsltVlekken/vkRegister.xsl"/>

  <xsl:param name="css" select="default.css"/>

<xsl:template match="/pagina">
<html>
  <head>
    <meta name="robots" content="noindex,nofollow"/>
    <xsl:element name="link">
      <xsl:attribute name="type">text/css</xsl:attribute>
      <xsl:attribute name="href">css/<xsl:value-of select="$css"
/></xsl:attribute>
      <xsl:attribute name="rel">stylesheet</xsl:attribute>
    </xsl:element>    
    <title><xsl:value-of select="page_title"/></title>
	<script type="text/javascript"
src="resources/forms/js/forms-lib.js"/>
	<link href="resources/forms/css/forms.css" type="text/css"
rel="stylesheet"/>
	<script type="text/javascript"
src="resources/forms/mattkruse-lib/AnchorPosition.js"/>
	<script type="text/javascript"
src="resources/forms/mattkruse-lib/PopupWindow.js"/>
  </head>
  <body>
    <table border="1" width="100%">
      <tbody>
        <tr>      
          <td colspan="2" align="right">
            <xsl:apply-templates select="vlek_portal_header_links"/>
          </td>
        </tr>
        <tr>        
          <td colspan="2">
            <xsl:apply-templates select="vlek_site_statistics"/>
          </td>                
        </tr>
        <tr>
          <td colspan="2">
            <xsl:apply-templates select="vlek_tab_menu"/>
          </td>
        </tr>
        <tr>
          <td rowspan="4">
            <xsl:apply-templates select="vlek_register"/>
          </td>
        </tr>          
      </tbody>
    </table>
  </body>
</html>
</xsl:template>


</xsl:stylesheet>
------------------------------------------------------------------------
-






The vkRegister.xsl has got the includes to the forms*.xsl's (maybe i'm
missing something here? I tried to add the namespace
xmlns:i18n="http://apache.org/cocoon/i18n/2.1" to the stylesheet, no
result...):

------------------------------------------------------------------------
-
<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="2.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns="http://www.w3.org/1999/xhtml">

  <xsl:include
href="resource://org/apache/cocoon/forms/resources/forms-page-styling.xs
l"/>
  <xsl:include
href="resource://org/apache/cocoon/forms/resources/forms-advanced-field-
styling.xsl"/>
  <!-- xsl:include
href="resource://org/apache/cocoon/forms/resources/forms-field-styling.x
sl"/-->

  <xsl:param name="resources-uri">resources</xsl:param>

    <xsl:template match="vlek_register">
      <h3><xsl:value-of select="head/title"/></h3>
      <br/><xsl:value-of select="titletext"/>
      <br/><h3><xsl:value-of select="bodytitle"/></h3>
    <xsl:apply-templates select="body"/>
</xsl:template>


</xsl:stylesheet>

------------------------------------------------------------------------
-


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


Mime
View raw message