diff --git a/DependencyInjection/A2lixTranslationFormExtension.php b/DependencyInjection/A2lixTranslationFormExtension.php index 0170da9..5716cd8 100644 --- a/DependencyInjection/A2lixTranslationFormExtension.php +++ b/DependencyInjection/A2lixTranslationFormExtension.php @@ -30,8 +30,9 @@ public function load(array $configs, ContainerBuilder $container) $container->setParameter('a2lix_translation_form.locale_provider', $config['locale_provider']); $container->setParameter('a2lix_translation_form.locales', $config['locales']); - $container->setParameter('a2lix_translation_form.default_locale', $container->getParameter('kernel.default_locale', 'en')); $container->setParameter('a2lix_translation_form.required_locales', $config['required_locales']); + $container->setParameter('a2lix_translation_form.default_locale', $config['default_locale'] ?: + $container->getParameter('kernel.default_locale', 'en')); $container->setParameter('a2lix_translation_form.templating', $config['templating']); diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 6b852b2..3954ef7 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -22,6 +22,7 @@ public function getConfigTreeBuilder() $rootNode ->children() ->scalarNode('locale_provider')->defaultValue('default')->end() + ->scalarNode('default_locale')->defaultNull()->end() ->arrayNode('locales') ->beforeNormalization() ->ifString()