Skip to content

Commit 2b35f38

Browse files
minor #16141 [FrameworkBundle] [Security] Remove trans from the security/core in 2.3 & dir loading (ogizanagi)
This PR was merged into the 2.3 branch. Discussion ---------- [FrameworkBundle] [Security] Remove trans from the security/core in 2.3 & dir loading | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | #16139, #16133 | License | MIT | Doc PR | - See #16139 (comment). I think the most efficient solution is to remove translations from `Security/Core` in 2.3 only (should not be propagated to newest branches!) and load both folders if they exist. Commits ------- 1ed07a0 [FrameworkBundle] [Security] Remove trans from the security/core in 2.3 & dir loading
2 parents ea10f24 + 1ed07a0 commit 2b35f38

File tree

3 files changed

+6
-150
lines changed

3 files changed

+6
-150
lines changed

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

+6-8
Original file line numberDiff line numberDiff line change
@@ -553,16 +553,14 @@ 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-
// 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';
559-
560-
if (!file_exists($translationsDir) && file_exists($dir = dirname($r->getFilename()).'/../../Resources/translations')) {
556+
if (file_exists(dirname($r->getFilename()).'/../composer.json')) {
557+
// with Symfony 2.4, the Security component was split into several subpackages
558+
// and the translations have been moved to the symfony/security-core package
559+
$dirs[] = dirname($r->getFilename()).'/../Resources/translations';
560+
} else {
561561
// in Symfony 2.3, translations are located in the symfony/security package
562-
$translationsDir = $dir;
562+
$dirs[] = dirname($r->getFilename()).'/../../Resources/translations';
563563
}
564-
565-
$dirs[] = $translationsDir;
566564
}
567565
$overridePath = $container->getParameter('kernel.root_dir').'/Resources/%s/translations';
568566
foreach ($container->getParameter('kernel.bundles') as $bundle => $class) {

src/Symfony/Component/Security/Core/Resources/translations/security.az.xlf

-71
This file was deleted.

src/Symfony/Component/Security/Core/Resources/translations/security.he.xlf

-71
This file was deleted.

0 commit comments

Comments
 (0)