Skip to content

Commit 610362b

Browse files
committed
Merge branch '5.3' into 5.4
* 5.3: (24 commits) [HttpFoundation] Fixed type mismatch Bump Symfony version to 5.3.6 Update VERSION for 5.3.5 Update CHANGELOG for 5.3.5 Update VERSION for 5.2.13 Update CHANGELOG for 5.2.13 Bump Symfony version to 4.4.29 Update VERSION for 4.4.28 Update CHANGELOG for 4.4.28 fix Check if it has session before getSession() [WebProfiler] "empty" filter bugfix. Filter with name "empty" is not exists in twig. Bump Symfony version to 5.3.5 Update VERSION for 5.3.4 Update CHANGELOG for 5.3.4 Bump Symfony version to 4.4.28 Update VERSION for 4.4.27 Update CONTRIBUTORS for 4.4.27 Update CHANGELOG for 4.4.27 Update VERSION for 5.2.12 Update CHANGELOG for 5.2.12 ...
2 parents f80d878 + 2c5ed14 commit 610362b

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,24 +1367,28 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
13671367
return;
13681368
}
13691369

1370-
foreach ($config['providers'] as $name => $provider) {
1371-
if (!$config['enabled_locales'] && !$provider['locales']) {
1372-
throw new LogicException(sprintf('You must specify one of "framework.translator.enabled_locales" or "framework.translator.providers.%s.locales" in order to use translation providers.', $name));
1370+
$locales = $config['enabled_locales'] ?? [];
1371+
1372+
foreach ($config['providers'] as $provider) {
1373+
if ($provider['locales']) {
1374+
$locales += $provider['locales'];
13731375
}
13741376
}
13751377

1378+
$locales = array_unique($locales);
1379+
13761380
$container->getDefinition('console.command.translation_pull')
13771381
->replaceArgument(4, array_merge($transPaths, [$config['default_path']]))
1378-
->replaceArgument(5, $config['enabled_locales'])
1382+
->replaceArgument(5, $locales)
13791383
;
13801384

13811385
$container->getDefinition('console.command.translation_push')
13821386
->replaceArgument(2, array_merge($transPaths, [$config['default_path']]))
1383-
->replaceArgument(3, $config['enabled_locales'])
1387+
->replaceArgument(3, $locales)
13841388
;
13851389

13861390
$container->getDefinition('translation.provider_collection_factory')
1387-
->replaceArgument(1, $config['enabled_locales'])
1391+
->replaceArgument(1, $locales)
13881392
;
13891393

13901394
$container->getDefinition('translation.provider_collection')->setArgument(0, $config['providers']);

0 commit comments

Comments
 (0)