From 7d9904d1f1e980b6a69d954d50ddca0c09bb2b59 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 29 Mar 2011 18:00:21 +1300 Subject: [PATCH] MINOR Moved Translatable::choose_site_locale() from LeftAndMain to CMSMain, its not necessary in other core controllers (other than specifically customized ModelAdmin instances) --- code/CMSMain.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/CMSMain.php b/code/CMSMain.php index 03df20c6..41ff9d32 100755 --- a/code/CMSMain.php +++ b/code/CMSMain.php @@ -77,6 +77,11 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr } public function init() { + // set reading lang + if(Object::has_extension('SiteTree', 'Translatable') && !$this->isAjax()) { + Translatable::choose_site_locale(array_keys(Translatable::get_existing_content_languages('SiteTree'))); + } + parent::init(); Requirements::javascript(CMS_DIR . '/javascript/CMSMain.js');