Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2453a58

Browse files
committed
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 :+1:
2 parents ea25267 + 44c8654 commit 2453a58

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,9 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
533533
// Use the "real" translator instead of the identity default
534534
$container->setAlias('translator', 'translator.default');
535535
$translator = $container->findDefinition('translator.default');
536+
if (!is_array($config['fallback'])) {
537+
$config['fallback'] = array($config['fallback']);
538+
}
536539
$translator->addMethodCall('setFallbackLocales', array($config['fallback']));
537540

538541
// Discover translation directories

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public function testTranslator()
219219
);
220220

221221
$calls = $container->getDefinition('translator.default')->getMethodCalls();
222-
$this->assertEquals('fr', $calls[0][1][0]);
222+
$this->assertEquals(array('fr'), $calls[0][1][0]);
223223
}
224224

225225
/**

0 commit comments

Comments
 (0)