parent
ba0154ab79
commit
d102a61e22
|
@ -314,13 +314,15 @@ class Web extends ApplicationBootstrap
|
||||||
protected function detectLocale()
|
protected function detectLocale()
|
||||||
{
|
{
|
||||||
$auth = Manager::getInstance();
|
$auth = Manager::getInstance();
|
||||||
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !$auth->isAuthenticated()
|
if ($auth->isAuthenticated()
|
||||||
|| ($locale = $auth->getUser()->getPreferences()->getValue('icingaweb', 'language')) === null
|
&& ($locale = $auth->getUser()->getPreferences()->getValue('icingaweb', 'language')) !== null
|
||||||
) {
|
) {
|
||||||
$locale = Translator::getPreferredLocaleCode($_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
return $locale;
|
||||||
}
|
}
|
||||||
|
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
|
||||||
return $locale;
|
return Translator::getPreferredLocaleCode($_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
||||||
|
}
|
||||||
|
return Translator::DEFAULT_LOCALE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue