merged branch fabpot/fix-setFallbackLocales (PR #7334)

This PR was merged into the master branch.

Commits
-------

44c8654 [FrameworkBundle] fixed regression for the translator fallback configuration (refs #7100, closes #7315)

Discussion
----------

[FrameworkBundle] fixed regression for the translator fallback configuration (refs #7100, closes #7315)

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #7315
| License       | MIT
| Doc PR        | n/a

---------------------------------------------------------------------------

by craue at 2013-03-11T22:09:35Z

👍
This commit is contained in:
Fabien Potencier 2013-03-11 23:10:38 +01:00
commit 2453a58d56
2 changed files with 4 additions and 1 deletions

View File

@ -533,6 +533,9 @@ class FrameworkExtension extends Extension
// Use the "real" translator instead of the identity default
$container->setAlias('translator', 'translator.default');
$translator = $container->findDefinition('translator.default');
if (!is_array($config['fallback'])) {
$config['fallback'] = array($config['fallback']);
}
$translator->addMethodCall('setFallbackLocales', array($config['fallback']));
// Discover translation directories

View File

@ -219,7 +219,7 @@ abstract class FrameworkExtensionTest extends TestCase
);
$calls = $container->getDefinition('translator.default')->getMethodCalls();
$this->assertEquals('fr', $calls[0][1][0]);
$this->assertEquals(array('fr'), $calls[0][1][0]);
}
/**