public function set_locale() { $request = $this->getRequest(); if ($request->isPost()) { $lang = $request->postvar('language'); if (empty($lang)) { return; } if ($lang == 'auto') { I18n::settings_set_autodetect(); } else { // sanitized in I18n class I18n::settings_set_language($lang); } } }