I was having trouble using that method without the helper. And althought it worked on my forms, after upgrade sfDoctrineGuardPlugin from 4.x to 5.0.0 the translations of its forms doesn't work (even if it uses my translated messages). I had to translate again the messages on the forms of sfDoctrineGuard.
Do you know why does this happen? Thanks. On Wed, Jul 28, 2010 at 4:42 AM, Tom Ptacnik <to...@tomor.cz> wrote: > 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<symfony-users%2bunsubscr...@googlegroups.com> > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- 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