Ok ok... 

Matthew Weier O'Phinney-3 wrote:
> 
> Currently, yes, but I'm considering adding an additional decorator for
> field and form hints for the 1.5.0 final release..
> 

Thanks :)



> Yes -- by passing a messages option to the validator when creating the
> element and/or validator.
> 
>     $element->addValidator(
>         'NotEmpty', 
>         false, 
>         array('messages' => array('isEmpty' => 'Alternate message'))
>     );
> 
> You can also pull out the validator object and set the messages you
> want.
> 
>     $element->getValidator('NotEmpty')->setMessage('isEmpty', 'Alternate
> message');
> 

Yes, that's why i asked... ok...



> So, there are a variety of ways to do this. However, if you use a
> translator object, then the translations will always be used, so the
> same translation will be used in all instances of a particular validator.
> 

How about having the fieldname prefixing the messageid in the language csv's
?

Some sort of "username.isEmpty;The string username cannot be empty" ?


-- 
View this message in context: 
http://www.nabble.com/Zend_Form-and-validation-language-tp15248574s16154p15292524.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to