X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Flanguages%2Ffr%2FLanguagesFrTest.php;h=0cf74891b7ab937403c2b6f6184975edeb5a2671;hb=9b2bd66fb60ffd5a833480bf329062c7d57bc8c4;hp=79d05172971896c67119513e739ce581f4a86737;hpb=d449f79a0d7ca808b891baf73b9e25ce7f7e48fe;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/languages/fr/LanguagesFrTest.php b/tests/languages/fr/LanguagesFrTest.php index 79d05172..0cf74891 100644 --- a/tests/languages/fr/LanguagesFrTest.php +++ b/tests/languages/fr/LanguagesFrTest.php @@ -172,4 +172,30 @@ class LanguagesFrTest extends \PHPUnit_Framework_TestCase $this->assertEquals('voiture', t($txt, $txt, 1, 'test')); $this->assertEquals('Fouille', t('Search', 'Search', 1, 'test')); } + + /** + * 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('coq', 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('coq', t($txt, $txt, 1, 'dummy')); + } }