Skip to content

Instantly share code, notes, and snippets.

@markuspoerschke
Created September 5, 2012 15:14
Show Gist options
  • Save markuspoerschke/3638157 to your computer and use it in GitHub Desktop.
Save markuspoerschke/3638157 to your computer and use it in GitHub Desktop.
Translate value in SonataAdminBundle list
class InvoiceAdmin extends Admin
{
// ...
protected function configureListFields(ListMapper $list)
{
$list
->addIdentifier('name')
// Use "trans" type to translate the given value
// EluceoInvoiceBundle_Status.**.xliff will be used for translation
->add('status', 'trans', array('catalogue' => 'EluceoInvoiceBundle_Status'))
->add('invoice_no')
->add('company')
->add('user');
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment