$w['stuff'] = new sfWidgetFormSelect( array('choices' => array('draft'
=> $this->__('draft'), 'published' => $this->__('published'))) );
protected function __($string, $args = array(), $catalogue =
'messages')
{
return $this->getI18N()->__($string, $args, $catalogue);
}
protected function getI18N()
{
return sfContext::getInstance()->getI18N();
}
If you really want to define your static choices in your model, I
would consider smthg like
$choices = DemoArticlePeer::getStatusChoices();
$i18nChoices = array_map(array($this, '__'), $choices);
hope this helps,
Cheers,
Cedric
http://sadai.net
On Jan 9, 4:17 pm, rené <[email protected]> wrote:
> Hello,
>
> I am trying to use I18N on a form that is using a custom Radio Choice as
> explained in:
>
> http://www.symfony-project.org/cookbook/1_2/en/make-a-choice#Customiz...
>
> What the best way to display a localized version the choice strings,
> e.g. "published", "draft" and "deleted" in the example above.
>
> Thanks for any help,
>
> René
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---