You are here

public function TranslatorTest::testSetFallbackLocalesMultiple in Plug 7

File

lib/Symfony/translation/Tests/TranslatorTest.php, line 126

Class

TranslatorTest

Namespace

Symfony\Component\Translation\Tests

Code

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'));
}