BUGFIX: Fix issue with language files not being included

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64471 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-10-16 23:39:19 +00:00
parent c45ef338d2
commit 6fe79bc1c6

View File

@ -1042,10 +1042,11 @@ class i18n extends Object {
*/
static function include_by_class($class) {
$module = self::get_owner_module($class);
if(!$module) user_error("i18n::include_by_class: Class {$class} not found", E_USER_WARNING);
if (file_exists($file = Director::getAbsFile("$module/lang/". self::get_locale() . '.php'))) {
include_once($file);
include($file);
} else if (self::get_locale() != self::$default_locale) {
$old = self::get_locale();
self::set_locale(self::$default_locale);