You can set a custom message to each validator, here for example, I changed
the validation group for the FOSUserBundle registration validation and set
my own validation messages as keywords:
http://pastebin.com/XJqmfSrj

<http://pastebin.com/XJqmfSrj>Hope that helps :)

2011/5/6 Leo Jokinen <leo.joki...@snoobi.com>

> Thanks for the tip Conrad.
>
> I got it working by creating file
> MyBundle/Resources/translations/validators.fi.yml
>
>
>
> However, I needed to map English text to Finnish: *This value should not
> be blank: Pakollinen kenttä*
>
>
>
> The book will advise to use keywords instead of real sentences in mapping:
>
> http://symfony.com/doc/2.0/book/translation.html#creating-translations
>
>
>
> Symfony\Component\Validator\Constraints\NotBlank.php declares the English
> version as a text and not with keyword:
>
> public $message = 'This value should not be blank';
>
>
>
> So how can I use keywords if Symfony components do not even use them?
>
>
>
> -Leo-
>
>
>
>
>
> *From:* symfony-users@googlegroups.com [mailto:
> symfony-users@googlegroups.com] *On Behalf Of *Conrad
> *Sent:* 6. toukokuuta 2011 15:38
> *To:* symfony-users@googlegroups.com
> *Subject:* [symfony-users] Aw: Symfony 2 beta1: How to translate form
> error messages?
>
>
>
> Validation messages are usally listed under the domain 'validatiors'.
>
> so for me, 'validators.en_US.yml' works without any problems :)
>
> --
> 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
>
> --
> 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
>

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

Reply via email to