Ah yes ofcourse, I try to place everything in the view, but since my messages are defined in a form class, it's not possible :( This option seems the best method as $i18n will only be local (best memory performance)
On Feb 16, 9:22 am, David Herrmann <[email protected]> wrote: > Iltar schrieb: > > > When i want a custom message for like a form error: > > array( > > 'min_length' => __('Your username cannot contain less then 6 > > characters.'), > > 'max_length' => __('Your username cannot contain more than 32 > > characters.') > > ) > > > The __() ofcourse doesn't work... How can i insert an english but make > > it translatable? > > You may load i18n like this: > > $i18n = sfContext::getInstance()->getI18N(); > array( > 'min_length' => $i18n->__('Your username cannot contain less then 6 > characters.'), > 'max_length' => $i18n->__('Your username cannot contain more than 32 > characters.') > ) > > Of course it might be better to place as many texts as possible in the > view layer, but sometimes this is the only valid option. > > David --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---
