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
-~----------~----~----~----~------~----~------~--~---

Reply via email to