aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/languages
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2018-02-26 22:53:00 +0100
committerArthurHoaro <arthur@hoa.ro>2018-03-26 19:20:25 +0200
commit68c6afc56f3758154cfb96cba6fd48a6b5535590 (patch)
treebabc499a94679e8897f70d3024d7b2c359f387e4 /tests/languages
parentddd3c19f4336495bbc8927fd552db0c4d9fe6662 (diff)
downloadShaarli-68c6afc56f3758154cfb96cba6fd48a6b5535590.tar.gz
Shaarli-68c6afc56f3758154cfb96cba6fd48a6b5535590.tar.zst
Shaarli-68c6afc56f3758154cfb96cba6fd48a6b5535590.zip
Load theme translations files automatically
Fixes #1077 Take a look at the docs update to see how it works
Diffstat (limited to 'tests/languages')
-rw-r--r--tests/languages/fr/LanguagesFrTest.php26
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}