diff --git a/DependencyInjection/Compiler/AddDependencyCallsCompilerPass.php b/DependencyInjection/Compiler/AddDependencyCallsCompilerPass.php index e106193cf7..9f47e0bc13 100644 --- a/DependencyInjection/Compiler/AddDependencyCallsCompilerPass.php +++ b/DependencyInjection/Compiler/AddDependencyCallsCompilerPass.php @@ -248,7 +248,7 @@ public function applyDefaults(ContainerBuilder $container, $serviceId, array $at 'menu_factory' => 'knp_menu.factory', 'route_builder' => 'sonata.admin.route.path_info'. (($manager_type == 'doctrine_phpcr') ? '_slashes' : ''), - 'label_translator_strategy' => 'sonata.admin.label.strategy.native', + 'label_translator_strategy' => 'sonata.admin.label.strategy.default', ); $definition->addMethodCall('setManagerType', array($manager_type)); diff --git a/Resources/config/core.xml b/Resources/config/core.xml index 6cba00261b..72845a0b24 100644 --- a/Resources/config/core.xml +++ b/Resources/config/core.xml @@ -33,7 +33,8 @@ - + + diff --git a/Resources/doc/reference/translation.rst b/Resources/doc/reference/translation.rst index bf79ba72a2..34689c276e 100644 --- a/Resources/doc/reference/translation.rst +++ b/Resources/doc/reference/translation.rst @@ -151,6 +151,16 @@ apps based on the field name. It is reasonable to start with the ``native`` stra and then, when the application needs to be translated using generic keys, the configuration can be switched to ``underscore``. +You can replace default strategy in ``config.yml``: + +.. configuration-block:: + + .. code-block:: yaml + + services: + sonata.admin.label.strategy.default: + alias: sonata.admin.label.strategy.underscore + The strategy can be quickly configured when the Admin class is registered in the Container: