public function TranslatorTest::testSetFallbackLocalesMultiple in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/translation/Tests/TranslatorTest.php \Symfony\Component\Translation\Tests\TranslatorTest::testSetFallbackLocalesMultiple()
File
- vendor/
symfony/ translation/ Tests/ TranslatorTest.php, line 126
Class
Namespace
Symfony\Component\Translation\TestsCode
public function testSetFallbackLocalesMultiple() {
$translator = new Translator('en');
$translator
->addLoader('array', new ArrayLoader());
$translator
->addResource('array', array(
'foo' => 'foo (en)',
), 'en');
$translator
->addResource('array', array(
'bar' => 'bar (fr)',
), 'fr');
// force catalogue loading
$translator
->trans('bar');
$translator
->setFallbackLocales(array(
'fr_FR',
'fr',
));
$this
->assertEquals('bar (fr)', $translator
->trans('bar'));
}