Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/unnecessary-joins-8614
Browse files Browse the repository at this point in the history
  • Loading branch information
lippserd committed Mar 12, 2015
2 parents 361afdc + 83443a5 commit 16c78c5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion application/layouts/scripts/parts/navigation.phtml
Expand Up @@ -21,7 +21,7 @@ if (! $this->auth()->isAuthenticated()) {
</li>
</ul>
</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">
<?= $this->partial(
'layout/menu.phtml',
Expand Down
18 changes: 11 additions & 7 deletions library/Icinga/Application/Web.php
Expand Up @@ -307,20 +307,24 @@ protected function detectTimezone()
/**
* 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()
{
$auth = Manager::getInstance();
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !$auth->isAuthenticated()
|| ($locale = $auth->getUser()->getPreferences()->getValue('icingaweb', 'language')) === null
if ($auth->isAuthenticated()
&& ($locale = $auth->getUser()->getPreferences()->getValue('icingaweb', 'language')) !== null
) {
$locale = Translator::getPreferredLocaleCode($_SERVER['HTTP_ACCEPT_LANGUAGE']);
return $locale;
}

return $locale;
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
return Translator::getPreferredLocaleCode($_SERVER['HTTP_ACCEPT_LANGUAGE']);
}
return Translator::DEFAULT_LOCALE;
}

/**
Expand Down

0 comments on commit 16c78c5

Please sign in to comment.