aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/LanguagesTest.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2018-03-26 20:26:10 +0200
committerGitHub <noreply@github.com>2018-03-26 20:26:10 +0200
commit9b2bd66fb60ffd5a833480bf329062c7d57bc8c4 (patch)
treed0a99bd7b366a9bdd6c92ab9e95db6dce4de1d3c /tests/LanguagesTest.php
parent838ef8a6ec140bd21124258e584be220be55048f (diff)
parent68c6afc56f3758154cfb96cba6fd48a6b5535590 (diff)
downloadShaarli-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/LanguagesTest.php')
-rw-r--r--tests/LanguagesTest.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/LanguagesTest.php b/tests/LanguagesTest.php
index 864ce630..4951e09a 100644
--- a/tests/LanguagesTest.php
+++ b/tests/LanguagesTest.php
@@ -176,6 +176,32 @@ class LanguagesTest extends \PHPUnit_Framework_TestCase
176 } 176 }
177 177
178 /** 178 /**
179 * Test t() with an extension language file coming from the theme in gettext mode
180 */
181 public function testTranslationThemeExtensionGettext()
182 {
183 $this->conf->set('translation.mode', 'gettext');
184 $this->conf->set('raintpl_tpl', 'tests/utils/customtpl/');
185 $this->conf->set('theme', 'dummy');
186 new Languages('en', $this->conf);
187 $txt = 'rooster'; // ignore me poedit
188 $this->assertEquals('rooster', t($txt, $txt, 1, 'dummy'));
189 }
190
191 /**
192 * Test t() with an extension language file coming from the theme in PHP mode
193 */
194 public function testTranslationThemeExtensionPhp()
195 {
196 $this->conf->set('translation.mode', 'php');
197 $this->conf->set('raintpl_tpl', 'tests/utils/customtpl/');
198 $this->conf->set('theme', 'dummy');
199 new Languages('en', $this->conf);
200 $txt = 'rooster'; // ignore me poedit
201 $this->assertEquals('rooster', t($txt, $txt, 1, 'dummy'));
202 }
203
204 /**
179 * Test t() with an extension language file in gettext mode 205 * Test t() with an extension language file in gettext mode
180 */ 206 */
181 public function testTranslationExtensionGettext() 207 public function testTranslationExtensionGettext()