From 403257de36de0c0cd9a03bb9380c6d45212a4b2a Mon Sep 17 00:00:00 2001 From: Andrew O'Neil Date: Tue, 6 Nov 2007 02:38:06 +0000 Subject: [PATCH] Site language and CMS locale are different, so we can't use one to set the other git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@44325 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/Translatable.php | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/core/model/Translatable.php b/core/model/Translatable.php index 85ca55a20..cbc3d6654 100755 --- a/core/model/Translatable.php +++ b/core/model/Translatable.php @@ -108,18 +108,14 @@ class Translatable extends DataObjectDecorator { */ static function choose_site_lang($langsAvailable = null) { if(is_array($langsAvailable)) { - if(isset($_GET['lang']) && in_array($_GET['lang'],$langsAvailable)) { + if(isset($_GET['lang']) && in_array($_GET['lang'], $langsAvailable)) { self::set_reading_lang($_GET['lang']); - } elseif(isset($_COOKIE['lang']) && in_array($_COOKIE['lang'],$langsAvailable)) { + } elseif(isset($_COOKIE['lang']) && in_array($_COOKIE['lang'], $langsAvailable)) { self::set_reading_lang($_COOKIE['lang']); - } else if(Session::get('currentLang') - && in_array(Session::get('currentLang'),$langsAvailable) - ) { + } else if(Session::get('currentLang') && in_array(Session::get('currentLang'), $langsAvailable)) { self::set_reading_lang(Session::get('currentLang')); - } else if (($member = Member::currentUser()) && ($lang = $member->Locale) - && in_array($lang,$langsAvailable) - ) { - self::set_reading_lang($lang); + } else { + self::set_reading_lang(self::default_lang()); } } else { if(isset($_GET['lang'])) { @@ -128,8 +124,6 @@ class Translatable extends DataObjectDecorator { self::set_reading_lang($_COOKIE['lang']); } else if(Session::get('currentLang')) { self::set_reading_lang(Session::get('currentLang')); - } else if (($member = Member::currentUser()) && ($lang = $member->Locale)) { - self::set_reading_lang($lang); } else { self::set_reading_lang(self::default_lang()); } @@ -740,4 +734,4 @@ class Translatable extends DataObjectDecorator { } } -?> \ No newline at end of file +?>