I am trying to implement a multilanguage site.
I have a hook handler for the hook sessions_start
that is supposed to set the language for a page. Here are the lines of code from the hook to change the language that I have tried.
$this->EE->config->_global_vars['language'] = 'xxxxx';
$this->EE->config->_global_vars['default_language'] = 'xxxxx';
$this->user_lang = "xxxxx";
But none of them worked.
Any idea how to change the language in a hook?
P.S. Tried this
public function do_sessions_start($session_object)
{
....
$session_object->userdata['language'] = "xxxxx";
}
But it seems it only works if the user is logged out. If logged in, the preference in the localization settings seems to overwrite.
We want to overwrite that.