public function TranslatorTest::testSetFallbackLocales in Plug 7
File
- lib/
Symfony/ translation/ Tests/ TranslatorTest.php, line 112
Class
Namespace
Symfony\Component\Translation\TestsCode
public function testSetFallbackLocales() {
$translator = new Translator('en');
$translator
->addLoader('array', new ArrayLoader());
$translator
->addResource('array', array(
'foo' => 'foofoo',
), 'en');
$translator
->addResource('array', array(
'bar' => 'foobar',
), 'fr');
// force catalogue loading
$translator
->trans('bar');
$translator
->setFallbackLocales(array(
'fr',
));
$this
->assertEquals('foobar', $translator
->trans('bar'));
}