Skip to content

Commit f37ceef

Browse files
[FrameworkBundle] Fix translations dir discovery
1 parent 59d8220 commit f37ceef

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -553,16 +553,16 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
553553
if (class_exists('Symfony\Component\Security\Core\Exception\AuthenticationException')) {
554554
$r = new \ReflectionClass('Symfony\Component\Security\Core\Exception\AuthenticationException');
555555

556-
$legacyTranslationsDir = dirname($r->getFilename()).'/../../Resources/translations';
556+
// with Symfony 2.4, the Security component was split into several subpackages
557+
// and the translations have been moved to the symfony/security-core package
558+
$translationsDir = dirname($r->getFilename()).'/../Resources/translations';
557559

558-
if (file_exists($legacyTranslationsDir)) {
560+
if (!file_exists($translationsDir) && file_exists($dir = dirname($r->getFilename()).'/../../Resources/translations')) {
559561
// in Symfony 2.3, translations are located in the symfony/security package
560-
$dirs[] = $legacyTranslationsDir;
561-
} else {
562-
// with Symfony 2.4, the Security component was split into several subpackages
563-
// and the translations have been moved to the symfony/security-core package
564-
$dirs[] = dirname($r->getFilename()).'/../Resources/translations';
562+
$translationsDir = $dir;
565563
}
564+
565+
$dirs[] = $translationsDir;
566566
}
567567
$overridePath = $container->getParameter('kernel.root_dir').'/Resources/%s/translations';
568568
foreach ($container->getParameter('kernel.bundles') as $bundle => $class) {

0 commit comments

Comments
 (0)