8000 Injected the value instead of defining a parameter · symfony/symfony@3a63bb2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3a63bb2

Browse files
committed
Injected the value instead of defining a parameter
1 parent 089b6ff commit 3a63bb2

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -677,9 +677,9 @@ private function addTranslatorSection(ArrayNodeDefinition $rootNode)
677677
->arrayNode('paths')
678678
->prototype('scalar')->end()
679679
->end()
680-
->variableNode('enabled_locales')
680+
->arrayNode('enabled_locales')
681+
->prototype('scalar')
681682
->defaultValue([])
682-
->treatNullLike([])
683683
->beforeNormalization()
684684
->always()
685685
->then(function ($config) {

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,6 +1039,8 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
10391039
$defaultOptions['cache_dir'] = $config['cache_dir'];
10401040
$translator->setArgument(4, $defaultOptions);
10411041

1042+
$translator->setArgument(6, $config['enabled_locales']);
1043+
10421044
$container->setParameter('translator.logging', $config['logging']);
10431045
$container->setParameter('translator.default_path', $config['default_path']);
10441046

@@ -1132,9 +1134,6 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
11321134

11331135
$translator->replaceArgument(4, $options);
11341136
}
1135-
1136-
// Register the enabled locales
1137-
$container->setParameter('translation.enabled_locales', $config['enabled_locales']);
11381137
}
11391138

11401139
private function registerValidationConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader, bool $propertyInfoEnabled)

src/Symfony/Bundle/FrameworkBundle/Resources/config/translation.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<argument key="cache_dir">%kernel.cache_dir%/translations</argument>
1717
<argument key="debug">%kernel.debug%</argument>
1818
</argument>
19-
<argument>%translation.enabled_locales%</argument>
19+
<argument /> <!-- enabled locales -->
2020
<call method="setConfigCacheFactory">
2121
<argument type="service" id="config_cache_factory" />
2222
</call>

0 commit comments

Comments
 (0)
0