I think that just sfValidatorBase::setDefaultMessage( 'required', 'Required field' ); is enough and the __() helper will be used automaticly.
On 27 čnc, 04:23, Gustavo Adrian <comfortablynum...@gmail.com> wrote: > Hi, > > I've found a way to do this in the BaseForm class. I just set the default > message of each validator on the "setup" method, like: > > // I use the __() function because I enabled the I18N helper by default > > sfValidatorBase::setDefaultMessage( 'required', __( 'Required field' ) ); > sfValidatorInteger::setDefaultMessage( 'min', __( 'message for "min" rule' ) > ); > > // etc.. > > It worked so far, althought I had the feeling that it wasn't the better way > to do this. And when I upgraded the sfDoctrineGuardPlugin from 4.x to 5.0.0 > the error messages were not i18n anymore, so my feeling was right :P > > Is a better way to do this? > > Thanks! -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en