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