Skip to content

Commit 3357441

Browse files
committed
bug symfony#54063 [FrameworkBundle] Fix registration of the bundle path to translation (FlyingDR)
This PR was merged into the 5.4 branch. Discussion ---------- [FrameworkBundle] Fix registration of the bundle path to translation | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | License | MIT 31d7a09 had a small issue resulting in a lack of proper registration of path to translation resources in installed bundles. The issue is caused by the incomplete update of the code where the newly added `$transPaths` variable was not updated in all code branches ([1](https://github.com/symfony/symfony/blob/85d01657a1a1aa65f57d0e0077fc7a10466acdd8/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php#L1330), [2](https://github.com/symfony/symfony/blob/85d01657a1a1aa65f57d0e0077fc7a10466acdd8/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php#L1335), [3](https://github.com/symfony/symfony/blob/85d01657a1a1aa65f57d0e0077fc7a10466acdd8/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php#L1340), but not [4](https://github.com/symfony/symfony/blob/85d01657a1a1aa65f57d0e0077fc7a10466acdd8/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php#L1345)) The issue can be reproduced and tested like this: ```bash composer create-project symfony/skeleton test cd test composer require easycorp/easyadmin-bundle php bin/console debug:translation en --domain EasyAdminBundle ``` It will result in unexpected: ``` [WARNING] No defined or extracted messages for locale "en" and domain "EasyAdminBundle" ``` After applying the fix, clearing the cache and running the same command list of messages will be returned properly. Commits ------- ae9e07e [FrameworkBundle] Fix registration of the bundle path to translation
2 parents 950ca75 + ae9e07e commit 3357441

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1342,7 +1342,7 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
13421342
$defaultDir = $container->getParameterBag()->resolveValue($config['default_path']);
13431343
foreach ($container->getParameter('kernel.bundles_metadata') as $name => $bundle) {
13441344
if ($container->fileExists($dir = $bundle['path'].'/Resources/translations') || $container->fileExists($dir = $bundle['path'].'/translations')) {
1345-
$dirs[] = $dir;
1345+
$dirs[] = $transPaths[] = $dir;
13461346
} else {
13471347
$nonExistingDirs[] = $dir;
13481348
}

0 commit comments

Comments
 (0)