[FrameworkBundle] Register security exception translations
This commit is contained in:
parent
d7129b9a7e
commit
d6c57cff6f
@ -527,6 +527,11 @@ class FrameworkExtension extends Extension
|
||||
|
||||
$dirs[] = dirname($r->getFilename()).'/Resources/translations';
|
||||
}
|
||||
if (class_exists('Symfony\Component\Security\Core\Exception\AuthenticationException')) {
|
||||
$r = new \ReflectionClass('Symfony\Component\Security\Core\Exception\AuthenticationException');
|
||||
|
||||
$dirs[] = dirname($r->getFilename()).'/../../Resources/translations';
|
||||
}
|
||||
$overridePath = $container->getParameter('kernel.root_dir').'/Resources/%s/translations';
|
||||
foreach ($container->getParameter('kernel.bundles') as $bundle => $class) {
|
||||
$reflection = new \ReflectionClass($class);
|
||||
|
@ -205,6 +205,11 @@ abstract class FrameworkExtensionTest extends TestCase
|
||||
$files,
|
||||
'->registerTranslatorConfiguration() finds Form translation resources'
|
||||
);
|
||||
$this->assertContains(
|
||||
'Symfony/Component/Security/Resources/translations/exceptions.en.xlf',
|
||||
$files,
|
||||
'->registerTranslatorConfiguration() finds Security translation resources'
|
||||
);
|
||||
|
||||
$calls = $container->getDefinition('translator.default')->getMethodCalls();
|
||||
$this->assertEquals('fr', $calls[0][1][0]);
|
||||
|
@ -29,7 +29,8 @@
|
||||
"doctrine/common": ">=2.2,<2.4-dev"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/finder": "2.2.*"
|
||||
"symfony/finder": "2.2.*",
|
||||
"symfony/security": "2.2.*"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/console": "2.2.*",
|
||||
|
Reference in New Issue
Block a user