mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 16:54:04 +02:00
Merge branch 'master' into bugfix/unnecessary-joins-8614
This commit is contained in:
commit
16c78c5cab
@ -21,7 +21,7 @@ if (! $this->auth()->isAuthenticated()) {
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div id="menu" data-last-update="<?= (time() - 14) ?>000" data-base-target="_main" class="container"
|
<div id="menu" data-last-update="-1" data-base-target="_main" class="container"
|
||||||
data-icinga-url="<?= $this->href('layout/menu') ?>" data-icinga-refresh="15">
|
data-icinga-url="<?= $this->href('layout/menu') ?>" data-icinga-refresh="15">
|
||||||
<?= $this->partial(
|
<?= $this->partial(
|
||||||
'layout/menu.phtml',
|
'layout/menu.phtml',
|
||||||
|
@ -307,20 +307,24 @@ class Web extends ApplicationBootstrap
|
|||||||
/**
|
/**
|
||||||
* Setup internationalization using gettext
|
* Setup internationalization using gettext
|
||||||
*
|
*
|
||||||
* Uses the preferred user language or the configured default and system default, respectively.
|
* Uses the preferred user language or the browser suggested language or our default.
|
||||||
*
|
*
|
||||||
* @return self
|
* @return string Detected locale code
|
||||||
|
*
|
||||||
|
* @see Translator::DEFAULT_LOCALE For the the default locale code.
|
||||||
*/
|
*/
|
||||||
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…
x
Reference in New Issue
Block a user