You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Steve Krulewitz <sh...@mm.st> on 2004/03/03 22:12:31 UTC

[cforms] Internationalization of custom error messages

Hey folks --

I'm using an output widget to display the error message that results 
from some custom validation code.  The problem is that I would like to 
internationalize the error message like the other validation-messages. 
Unfortunately, the output widget just dumps the value out to the page.

Is there any way to achieve this with the current output widget, or is 
there a better way to serve the custom error messages?  If not, I 
propose an i18n-output widget (or an option to the existing output 
widget?) that will render the value of the widget wrapped in 18n:text 
tags so the I18nTransformer can translate with the rest of the form.

Also, on the subject of cforms i18n, it would also be handy if the 
widget's label was included as a i18n parameter for the standard 
validation-errors.  This way instead of just "This field is required" 
you could have "Email Address is required."

cheers,
-steve

Re: [cforms] Internationalization of custom error messages

Posted by Bruno Dumon <br...@outerthought.org>.
On Wed, 2004-03-03 at 22:12, Steve Krulewitz wrote:
> Hey folks --
> 
> I'm using an output widget to display the error message that results 
> from some custom validation code.  The problem is that I would like to 
> internationalize the error message like the other validation-messages. 
> Unfortunately, the output widget just dumps the value out to the page.
> 
> Is there any way to achieve this with the current output widget, or is 
> there a better way to serve the custom error messages?  If not, I 
> propose an i18n-output widget (or an option to the existing output 
> widget?) that will render the value of the widget wrapped in 18n:text 
> tags so the I18nTransformer can translate with the rest of the form.

Do you know about the wd:messages widget? Should do what you want.
There's a sample that shows how to use it.

<snip/>

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org