$this->assertEquals($text, t($text));
}
+ /**
+ * Test t() with an extension language file coming from the theme in gettext mode
+ */
+ public function testTranslationThemeExtensionGettext()
+ {
+ $this->conf->set('translation.mode', 'gettext');
+ $this->conf->set('raintpl_tpl', 'tests/utils/customtpl/');
+ $this->conf->set('theme', 'dummy');
+ new Languages('en', $this->conf);
+ $txt = 'rooster'; // ignore me poedit
+ $this->assertEquals('rooster', t($txt, $txt, 1, 'dummy'));
+ }
+
+ /**
+ * Test t() with an extension language file coming from the theme in PHP mode
+ */
+ public function testTranslationThemeExtensionPhp()
+ {
+ $this->conf->set('translation.mode', 'php');
+ $this->conf->set('raintpl_tpl', 'tests/utils/customtpl/');
+ $this->conf->set('theme', 'dummy');
+ new Languages('en', $this->conf);
+ $txt = 'rooster'; // ignore me poedit
+ $this->assertEquals('rooster', t($txt, $txt, 1, 'dummy'));
+ }
+
/**
* Test t() with an extension language file in gettext mode
*/
$this->conf->set('translation.mode', 'gettext');
$this->conf->set('translation.extensions.test', 'tests/utils/languages/');
new Languages('en', $this->conf);
- $this->assertEquals('car', t('car', 'car', 1, 'test'));
+ $txt = 'car'; // ignore me poedit
+ $this->assertEquals('car', t($txt, $txt, 1, 'test'));
$this->assertEquals('Search', t('Search', 'Search', 1, 'test'));
}
$this->conf->set('translation.mode', 'php');
$this->conf->set('translation.extensions.test', 'tests/utils/languages/');
new Languages('en', $this->conf);
- $this->assertEquals('car', t('car', 'car', 1, 'test'));
+ $txt = 'car'; // ignore me poedit
+ $this->assertEquals('car', t($txt, $txt, 1, 'test'));
$this->assertEquals('Search', t('Search', 'Search', 1, 'test'));
}
}