diff options
author | ArthurHoaro <arthur@hoa.ro> | 2018-03-26 20:26:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-26 20:26:10 +0200 |
commit | 9b2bd66fb60ffd5a833480bf329062c7d57bc8c4 (patch) | |
tree | d0a99bd7b366a9bdd6c92ab9e95db6dce4de1d3c /tests/languages | |
parent | 838ef8a6ec140bd21124258e584be220be55048f (diff) | |
parent | 68c6afc56f3758154cfb96cba6fd48a6b5535590 (diff) | |
download | Shaarli-9b2bd66fb60ffd5a833480bf329062c7d57bc8c4.tar.gz Shaarli-9b2bd66fb60ffd5a833480bf329062c7d57bc8c4.tar.zst Shaarli-9b2bd66fb60ffd5a833480bf329062c7d57bc8c4.zip |
Merge pull request #1093 from ArthurHoaro/feature/theme-translation
Load theme translations files automatically
Diffstat (limited to 'tests/languages')
-rw-r--r-- | tests/languages/fr/LanguagesFrTest.php | 26 |
1 files changed, 26 insertions, 0 deletions
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 | |||
172 | $this->assertEquals('voiture', t($txt, $txt, 1, 'test')); | 172 | $this->assertEquals('voiture', t($txt, $txt, 1, 'test')); |
173 | $this->assertEquals('Fouille', t('Search', 'Search', 1, 'test')); | 173 | $this->assertEquals('Fouille', t('Search', 'Search', 1, 'test')); |
174 | } | 174 | } |
175 | |||
176 | /** | ||
177 | * Test t() with an extension language file coming from the theme in gettext mode | ||
178 | */ | ||
179 | public function testTranslationThemeExtensionGettext() | ||
180 | { | ||
181 | $this->conf->set('translation.mode', 'gettext'); | ||
182 | $this->conf->set('raintpl_tpl', 'tests/utils/customtpl/'); | ||
183 | $this->conf->set('theme', 'dummy'); | ||
184 | new Languages('en', $this->conf); | ||
185 | $txt = 'rooster'; // ignore me poedit | ||
186 | $this->assertEquals('coq', t($txt, $txt, 1, 'dummy')); | ||
187 | } | ||
188 | |||
189 | /** | ||
190 | * Test t() with an extension language file coming from the theme in PHP mode | ||
191 | */ | ||
192 | public function testTranslationThemeExtensionPhp() | ||
193 | { | ||
194 | $this->conf->set('translation.mode', 'php'); | ||
195 | $this->conf->set('raintpl_tpl', 'tests/utils/customtpl/'); | ||
196 | $this->conf->set('theme', 'dummy'); | ||
197 | new Languages('en', $this->conf); | ||
198 | $txt = 'rooster'; // ignore me poedit | ||
199 | $this->assertEquals('coq', t($txt, $txt, 1, 'dummy')); | ||
200 | } | ||
175 | } | 201 | } |