mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Fixed i18n bug on safe mode
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@51503 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
8d4f0d006f
commit
3d83f43eff
@ -833,6 +833,8 @@ class i18n extends Controller {
|
|||||||
$baseDir = Director::baseFolder();
|
$baseDir = Director::baseFolder();
|
||||||
$modules = scandir($baseDir);
|
$modules = scandir($baseDir);
|
||||||
foreach($modules as $module) {
|
foreach($modules as $module) {
|
||||||
|
if($module[0] == '.') continue;
|
||||||
|
|
||||||
$moduleDir = $baseDir . DIRECTORY_SEPARATOR . $module;
|
$moduleDir = $baseDir . DIRECTORY_SEPARATOR . $module;
|
||||||
$langDir = $moduleDir . DIRECTORY_SEPARATOR . "lang";
|
$langDir = $moduleDir . DIRECTORY_SEPARATOR . "lang";
|
||||||
if(is_dir($moduleDir) && is_file($moduleDir . DIRECTORY_SEPARATOR . "_config.php") && is_dir($langDir)) {
|
if(is_dir($moduleDir) && is_file($moduleDir . DIRECTORY_SEPARATOR . "_config.php") && is_dir($langDir)) {
|
||||||
|
10
tests/i18nTest.php
Normal file
10
tests/i18nTest.php
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class i18nTest extends SapphireTest {
|
||||||
|
function testGetExistingTranslations() {
|
||||||
|
$translations = i18n::get_existing_translations();
|
||||||
|
$this->assertTrue(isset($translations['en_US']), 'Checking for en_US translation');
|
||||||
|
$this->assertTrue(isset($translations['de_DE']), 'Checking for de_DE translation');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user