Search code examples
phpsymfonydatagridsonata-adminsonata

Symfony2 - Sonata Datagrid filter operators translation fails for doctrine_orm_class field


In my Symfony project (2.5.7) I use Sonata Admin Bundle 2.3. In Admin class I specified my DataGridForm as follows:

protected function configureDatagridFilters(DatagridMapper $datagrid)    
{    
$datagrid    
->add('name')    
->add('created_by_user');    
}    

Where name is text and created_by_user is one-to-many relation to user class. As a result I have beautiful filters form but operators at created_by_user field, which are label_type_equals and label_type_not_equals, are not translated. Translations are provided for the other field: name: label_type_contains, label_type_not_contains, label_type_equals, which is good.

In my app/config/config.yml I set:

framework:    
   translator: { fallback: "pl" }    

The translations are provided by SonataAdminBundle in SonataAdminBundle.pl.xliff, located in vendor/sonata-project/admin-bundle/Resources/translations.

Any other label is translated. Only the ones connected to doctrine_orm_class type are not.

Please give me some idea to solve this problem. Thanks.


Solution

  • As I upgraded the packages the missing translations occured. I upgraded to SonataAdminBundle 2.3.3, but I'm not so sure about this was the solution. Nevertheless I'm not able to repeate this problem.