cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joost Kuif" <Joost.k...@mobillion.nl>
Subject RE: general.field-required translation not working
Date Wed, 18 Jan 2006 15:23:31 GMT
Thanks a lot Jason and Bruno! It Works :)

Joost

-----Oorspronkelijk bericht-----
Van: Jason Johnston [mailto:cocoon@lojjic.net] 
Verzonden: Wednesday, January 18, 2006 3:30 PM
Aan: users@cocoon.apache.org
Onderwerp: Re: general.field-required translation not working

Joost Kuif wrote:
> 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 i18n elements produced by CForms all have an attribute 
i18n:catalogue="forms", which means that the i18n transformer will 
always look for a catalogue configured with the id "forms" to get its 
translations for these elements.  The example above works because you're

not telling it to use a specific catalogue, so it uses whichever default

catalogue you have configured in your sitemap.

You need to have something like this in your sitemap:

<map:transformer name="i18n" 
src="org.apache.cocoon.transformation.I18nTransformer">
    <catalogues default="default">
       <catalogue id="forms" name="Messages" location="path/to/forms"/>
       <catalogue id="default" name="Messages" location="path/to/i18n"/>
    </catalogues>
</map:transformer>

And make sure your overridden CForms messages are in the "forms" 
catalogue.  See the I18nTransformer docs for more details about setting 
up catalogues.

Hope that helps
--Jason

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




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


Mime
View raw message