Skip to content

[FrameworkBundle] [Security] Remove trans from the security/core in 2.3 & dir loading #16141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -553,16 +553,14 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
if (class_exists('Symfony\Component\Security\Core\Exception\AuthenticationException')) {
$r = new \ReflectionClass('Symfony\Component\Security\Core\Exception\AuthenticationException');

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

if (!file_exists($translationsDir) && file_exists($dir = dirname($r->getFilename()).'/../../Resources/translations')) {
if (file_exists(dirname($r->getFilename()).'/../composer.json')) {
// with Symfony 2.4, the Security component was split into several subpackages
// and the translations have been moved to the symfony/security-core package
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this comment is not completely right (we have translations in both packages). And by the way, having duplicated translations directories leads to inconsistent translations (for example, #15955 changed only one of the two translation files).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, we have them outside of Core for BC reasons (using them is deprecated and they are removed in 3.0)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, but then removing them from core in Symfony 2.3 is confusing for users imho if they should rely on them again after upgrading.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, they should be no translation in security-core in 2.3 (they have been moved there in 2.4). the existing ones there in the 2.3 branch are mistakes when switching branch for merges IMO

$dirs[] = dirname($r->getFilename()).'/../Resources/translations';
} else {
// in Symfony 2.3, translations are located in the symfony/security package
$translationsDir = $dir;
$dirs[] = dirname($r->getFilename()).'/../../Resources/translations';
}

$dirs[] = $translationsDir;
}
$overridePath = $container->getParameter('kernel.root_dir').'/Resources/%s/translations';
foreach ($container->getParameter('kernel.bundles') as $bundle => $class) {
Expand Down

This file was deleted.

This file was deleted.