Skip to content

Commit 1696f56

Browse files
committed
bug #37028 [FrameworkBundle] Fix enabled_locales behavior (tgalopin)
This PR was merged into the 5.1 branch. Discussion ---------- [FrameworkBundle] Fix enabled_locales behavior | Q | A | ------------- | --- | Branch? | 5.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - I was experimenting with enabled_locales on my application and I noticed the cache didn't actually change. It seems the generated service definition was invalid: the file `var/cache/dev/ContainerFEQLy1x/App_KernelDevDebugContainer.php` defined `getTranslator_DefaultService` by calling `new Translator` with 7 arguments instead of 6. It seems to be due to the fact that the DI extension does not replace the right argument. With the following fix applied the behavior works as expected. However, reading the comment of Javier in #32433, it seems he tested it against Demo and it worked with the previous code. I'm not sure why, @javiereguiluz I'd be interested in knowing if I'm missing something here :) . Commits ------- e2ce7f5 Fix enabled_locales behavior
2 parents 2af156d + e2ce7f5 commit 1696f56

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,7 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
10941094
$defaultOptions['cache_dir'] = $config['cache_dir'];
10951095
$translator->setArgument(4, $defaultOptions);
10961096

1097-
$translator->setArgument(6, $config['enabled_locales']);
1097+
$translator->setArgument(5, $config['enabled_locales']);
10981098

10991099
$container->setParameter('translator.logging', $config['logging']);
11001100
$container->setParameter('translator.default_path', $config['default_path']);

0 commit comments

Comments
 (0)