Exemple #1
0
 /**
  * @group ZF-9489
  */
 public function testAddingAdapterToSourcealsUsingOwnRule()
 {
     $translate = new Translator\Translator(Translator\Translator::AN_ARRAY, array('singular' => array('plural_0 (en)', 'plural_1 (en)', 'plural_2 (en)', 'plural_3 (en)'), 'plural' => ''), 'en');
     $this->assertFalse($translate->isTranslated('Message 1'));
     $adapter = new Adapter\Gettext(__DIR__ . '/Adapter/_files/translation_en.mo', 'en');
     $translate->addTranslation($adapter);
     $this->assertTrue($adapter->isTranslated('Message 1'));
     $adapter2 = new Adapter\Gettext(__DIR__ . '/Adapter/_files/testmo/de_AT/LC_TEST/translation-de_DE.mo', 'de_AT');
     $adapter2->addTranslation(__DIR__ . '/Adapter/_files/translation_en2.mo', 'fr');
     $translate->addTranslation($adapter2, 'fr');
     $languages = $translate->getList();
     $this->assertFalse(array_key_exists('de_AT', $languages));
     $this->assertTrue(array_key_exists('fr', $languages));
 }