From 3d83f43effc31d4238e16457d7205b66251bf8f6 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Thu, 20 Mar 2008 03:00:49 +0000 Subject: [PATCH] Fixed i18n bug on safe mode git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@51503 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/i18n.php | 2 ++ tests/i18nTest.php | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 tests/i18nTest.php diff --git a/core/i18n.php b/core/i18n.php index 0147b2142..54e463636 100755 --- a/core/i18n.php +++ b/core/i18n.php @@ -833,6 +833,8 @@ class i18n extends Controller { $baseDir = Director::baseFolder(); $modules = scandir($baseDir); foreach($modules as $module) { + if($module[0] == '.') continue; + $moduleDir = $baseDir . DIRECTORY_SEPARATOR . $module; $langDir = $moduleDir . DIRECTORY_SEPARATOR . "lang"; if(is_dir($moduleDir) && is_file($moduleDir . DIRECTORY_SEPARATOR . "_config.php") && is_dir($langDir)) { diff --git a/tests/i18nTest.php b/tests/i18nTest.php new file mode 100644 index 000000000..a2b442d01 --- /dev/null +++ b/tests/i18nTest.php @@ -0,0 +1,10 @@ +assertTrue(isset($translations['en_US']), 'Checking for en_US translation'); + $this->assertTrue(isset($translations['de_DE']), 'Checking for de_DE translation'); + } + +} \ No newline at end of file