mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-05-07 05:57:52 +02:00
Fix language change requiring a logout to be applied (still requires a second page reload)
This commit is contained in:
@@ -96,8 +96,6 @@ class Admin
|
||||
$this->uri = $this->grav['uri'];
|
||||
$this->session = $this->grav['session'];
|
||||
$this->user = $this->grav['user'];
|
||||
$this->lang = $this->grav['user']->language;
|
||||
|
||||
|
||||
$language = $this->grav['language'];
|
||||
if ($language->enabled()) {
|
||||
@@ -653,7 +651,7 @@ class Admin
|
||||
* @param $string the string to translate
|
||||
*/
|
||||
public function translate($string) {
|
||||
return $this->grav['language']->translate($string, [$this->grav['user']->authenticated ? $this->lang : 'en']);
|
||||
return $this->grav['language']->translate($string, [$this->grav['user']->authenticated ? $this->grav['user']->language : 'en']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user