Simply overload the template that echoes the flashes, and add a __() around,
no ?

Regards,

Before Printing, Think about Your Environmental Responsibility!
Avant d'Imprimer, Pensez à Votre Responsabilitée Environnementale!


On Sat, Feb 5, 2011 at 11:50 AM, Gabriel Petchesi <[email protected]>wrote:

> You can do it either in:
> 1. Action
>
> http://www.symfony-project.org/gentle-introduction/1_4/en/13-I18n-and-L10n#chapter_13_sub_calling_the_translation_helper_outside_a_template
> <http://www.symfony-project.org/gentle-introduction/1_4/en/13-I18n-and-L10n#chapter_13_sub_calling_the_translation_helper_outside_a_template>2.
> Template
>     echo __($sf_user->getFlash('error'))
>
> I think that the second option is recommended.
>
>     gabriel
>
>
> On Friday, February 4, 2011 3:55:14 PM UTC+2, ricvec wrote:
>>
>> Hello everybody,
>> the subject of this topic is quite clear; I'd like to know how can I
>> localized the flash warnings/errors or some workaround to do it.
>> In my example I have this lines in the class actions.class.php for the
>> user model:
>>
>> $q = Doctrine_Query::create()
>>     ->from('WeeventUser wu')
>>     ->where('wu.username = ?', $request->getParameter('username'))
>>     ->andWhere('wu.password = ?', $request->getParameter('password'));
>>
>>
>>   $weevent_users = $q->execute();
>>
>>     if (count($weevent_users)==1)
>>       $this->redirect('user/show?id='.$weevent_users[0]->getId());
>>     else{
>>       $this->getUser()->setFlash('error', __('Username or password are
>> wrong'));
>>       $this->redirect('user/login');
>>     }
>>
>> Thank you very much
>>
>> Riccardo
>
>  --
> 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 [email protected]
> To unsubscribe from this group, send email to
> [email protected]<symfony-users%[email protected]>
> 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 [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