Skip to content

Commit

Permalink
Merge pull request #163 from Rvanlaak/master
Browse files Browse the repository at this point in the history
Allow bundle to override default_locale
  • Loading branch information
webda2l committed Dec 2, 2014
2 parents 72936f6 + e6e8f76 commit 390e327
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion DependencyInjection/A2lixTranslationFormExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);

Expand Down
1 change: 1 addition & 0 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public function getConfigTreeBuilder()
$rootNode
->children()
->scalarNode('locale_provider')->defaultValue('default')->end()
->scalarNode('default_locale')->defaultNull()->end()
->arrayNode('locales')
->beforeNormalization()
->ifString()
Expand Down

0 comments on commit 390e327

Please sign in to comment.