MINOR Moved Translatable::choose_site_locale() from LeftAndMain to CMSMain, its not necessary in other core controllers (other than specifically customized ModelAdmin instances)

This commit is contained in:
Ingo Schommer 2011-03-29 18:00:21 +13:00
parent 466add9bb2
commit 7d9904d1f1

View File

@ -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');