You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Markus Grell <ta...@military.de> on 2012/03/01 11:09:41 UTC

Global validation messages translation

Greetings!

I need to translate the messages of the standard validators. The Tapestry
documentation reads:

-----
Each validator (such as "required" or "minlength") has a default message
used (on the client side and the server side) when the constraint is
violated; that is, when the user input is not valid.

The message can be customized by adding an entry to the page's message
catalog (or the containing component's message catalog). As with any
localized property, this can also go into the application's message
catalog.
-----

Since it is quite uncomfortable to add a property file for every page that
uses a standard validator ("You must provide a value for XY"):

Is it possible to override the default message with a translation? I 
didn't find info on that (or just did misunderstand existing documentation
;))

Markus



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


Re: Global validation messages translation

Posted by Donyee <xy...@gmail.com>.
the default FormValid message is in the package
org.apache.tapestry5.internal
you can add same package in your resource file, add a new file
ValidationMessage.properties
this will override the default one.
it works in my project!


2012/3/1 Markus Grell <ta...@military.de>

> Greetings!
>
> I need to translate the messages of the standard validators. The Tapestry
> documentation reads:
>
> -----
> Each validator (such as "required" or "minlength") has a default message
> used (on the client side and the server side) when the constraint is
> violated; that is, when the user input is not valid.
>
> The message can be customized by adding an entry to the page's message
> catalog (or the containing component's message catalog). As with any
> localized property, this can also go into the application's message
> catalog.
> -----
>
> Since it is quite uncomfortable to add a property file for every page that
> uses a standard validator ("You must provide a value for XY"):
>
> Is it possible to override the default message with a translation? I
> didn't find info on that (or just did misunderstand existing documentation
> ;))
>
> Markus
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Yet Another Java EE Developer!