Skip to content

Commit

Permalink
merged branch fabpot/fix-setFallbackLocales (PR #7334)
Browse files Browse the repository at this point in the history
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:
  • Loading branch information
fabpot committed Mar 11, 2013
2 parents ea25267 + 44c8654 commit 2453a58
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Expand Up @@ -533,6 +533,9 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
// 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
Expand Down
Expand Up @@ -219,7 +219,7 @@ public function testTranslator()
);

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

/**
Expand Down

0 comments on commit 2453a58

Please sign in to comment.