I'm sorry, but you're a bit wrong here; it is not "text to translate"
that goes as the second argument, but instead the translation function
name

if a custom function is defined in the form class, it should be:
$this->widgetSchema->getFormFormatter()->setTranslationCallable
('myCustomTranslationFunction');

if it is facilitated by a separate class it must be:
1) for a static function:
$this->widgetSchema->getFormFormatter()->setTranslationCallable(array
('myI18nClass', 'myCustomTranslationFunction'));
2) for non-static function, as in the example given in the
documentation
$this->widgetSchema->getFormFormatter()->setTranslationCallable(array
(new myI18nClass(), 'myCustomTranslationFunction'));

On Jan 13, 9:06 am, "Nicolas Perriault" <nperria...@gmail.com> wrote:
> On Mon, Jan 12, 2009 at 4:59 PM, google <goo...@yucai.de> wrote:
> > But it doesn't seem very clean to have to define the __() and getI18N
> > () methods in the Form. Is there a better place to define these static
> > choice strings? To me it appears that they are part of the model.
>
> You can define a translation callable by using:
> $widgetSchema->getFormFormatter()->setTranslationCallable(array(new
> myI18n(), 'text to translate'));
>
> More information herehttp://bit.ly/6sNm
>
> ++
>
> --
> Nicolas 
> Perriaulthttp://prendreuncafe.com-http://symfonians.net-http://sensiolabs.com
> Phone: +33 660 92 08 67
--~--~---------~--~----~------------~-------~--~----~
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