Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2763dc1

Browse files
committed
Improvements
1 parent b78a367 commit 2763dc1

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ private function addTranslatorSection(ArrayNodeDefinition $rootNode)
767767
->prototype('scalar')->end()
768768
->end()
769769
->variableNode('enabled_locales')
770-
->defaultNull()
770+
->defaultValue('%kernel.default_locale%')
771771
->beforeNormalization()->ifString()->castToArray()->end()
772772
->end()
773773
->end()

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,10 +1232,7 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
12321232
$translator->replaceArgument(4, $options);
12331233
}
12341234

1235-
// Process and register the enabled locales
1236-
if (null === $config['enabled_locales'] && null !== $defaultLocale = $container->getParameter('kernel.default_locale')) {
1237-
$config['enabled_locales'] = [$defaultLocale];
1238-
}
1235+
// Register the enabled locales
12391236
$container->setParameter('translation.enabled_locales', $config['enabled_locales']);
12401237
}
12411238

src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function warmUp($cacheDir)
102102
}
103103

104104
$locales = array_merge($this->getFallbackLocales(), [$this->getLocale()], $this->resourceLocales);
105-
$localesToWarmUp = $this->enabledLocales ?? $locales;
105+
$localesToWarmUp = array_unique($this->enabledLocales ?? $locales);
106106
foreach ($localesToWarmUp as $locale) {
107107
// reset catalogue in case it's already loaded during the dump of the other locales.
108108
if (isset($this->catalogues[$locale])) {

0 commit comments

Comments
 (0)