Skip to content
Snippets Groups Projects
Commit 65e94ed7 authored by Jared Hancock's avatar Jared Hancock
Browse files

i18n: Switch language immediately on profile update

parent bbd35ea4
No related branches found
No related tags found
No related merge requests found
......@@ -372,10 +372,6 @@ class Internationalization {
static function getCurrentLanguage($user=false) {
global $thisstaff, $thisclient;
static $session = null;
if (!isset($session))
$session = &$_SESSION['::lang'];
$user = $user ?: $thisstaff ?: $thisclient;
if ($user && method_exists($user, 'getLanguage'))
......@@ -383,8 +379,8 @@ class Internationalization {
return $lang;
// Support the flag buttons for guests
if ((!$user || $user != $thisstaff) && $session)
return $session;
if ((!$user || $user != $thisstaff) && $_SESSION['::lang'])
return $_SESSION['::lang'];
return self::getDefaultLanguage();
}
......
......@@ -603,9 +603,6 @@ implements AuthenticatedUser, EmailContact, TemplateVariable {
if($errors) return false;
$_SESSION['::lang'] = null;
TextDomain::configureForUser($this);
$this->firstname = $vars['firstname'];
$this->lastname = $vars['lastname'];
$this->email = $vars['email'];
......@@ -622,6 +619,9 @@ implements AuthenticatedUser, EmailContact, TemplateVariable {
$this->default_paper_size = $vars['default_paper_size'];
$this->lang = $vars['lang'];
$_SESSION['::lang'] = null;
TextDomain::configureForUser($this);
return $this->save();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment