layout: Identify language using ipl-i18n

This commit is contained in:
Johannes Meyer 2021-05-20 09:46:11 +02:00
parent 84757111d1
commit 86614ad7a8
2 changed files with 14 additions and 4 deletions

View File

@ -1,8 +1,13 @@
<?php
use Icinga\Util\Translator;
use ipl\I18n\Locale;
use ipl\I18n\GettextTranslator;
use ipl\I18n\StaticTranslator;
$lang = Translator::splitLocaleCode()->language;
/** @var GettextTranslator $translator */
$translator = StaticTranslator::$instance;
$lang = (new Locale())->parseLocale($translator->getLocale())->language;
$showFullscreen = $this->layout()->showFullscreen;
$innerLayoutScript = $this->layout()->innerLayout . '.phtml';

View File

@ -1,6 +1,8 @@
<?php
use Icinga\Util\Translator;
use ipl\I18n\Locale;
use ipl\I18n\GettextTranslator;
use ipl\I18n\StaticTranslator;
use ipl\Web\Widget\Icon;
if (array_key_exists('_dev', $_GET)) {
@ -11,8 +13,11 @@ if (array_key_exists('_dev', $_GET)) {
$cssfile = 'css/icinga.min.css';
}
/** @var GettextTranslator $translator */
$translator = StaticTranslator::$instance;
$lang = (new Locale())->parseLocale($translator->getLocale())->language;
$timezone = date_default_timezone_get();
$lang = Translator::splitLocaleCode()->language;
$isIframe = $this->layout()->isIframe;
$showFullscreen = $this->layout()->showFullscreen;
$iframeClass = $isIframe ? ' iframe' : '';