diff --git a/components/ILIAS/Language/classes/Setup/class.ilPluginLanguageUpdatedObjective.php b/components/ILIAS/Language/classes/Setup/class.ilPluginLanguageUpdatedObjective.php index 2b6c4c93ba95..eed74f1bfdb0 100755 --- a/components/ILIAS/Language/classes/Setup/class.ilPluginLanguageUpdatedObjective.php +++ b/components/ILIAS/Language/classes/Setup/class.ilPluginLanguageUpdatedObjective.php @@ -142,10 +142,6 @@ protected function initEnvironment(Setup\Environment $environment, \ilComponentR public function __construct() { } - public static function getRootLogger(): ilLogger - { - return $GLOBALS["DIC"]["ilLog"]; - } public static function getLogger(string $a_component_id): ilLogger { return $GLOBALS["DIC"]["ilLog"]; @@ -188,7 +184,11 @@ public function __construct() $GLOBALS["DIC"]["ilUser"] = new class () extends ilObjUser { public function __construct() { - $this->prefs["language"] = "en"; + } + + public function getLanguage(): string + { + return 'en'; } }; diff --git a/components/ILIAS/Language/classes/class.ilLanguage.php b/components/ILIAS/Language/classes/class.ilLanguage.php index 5ddea200dd2e..6ad0ccb21a83 100755 --- a/components/ILIAS/Language/classes/class.ilLanguage.php +++ b/components/ILIAS/Language/classes/class.ilLanguage.php @@ -25,6 +25,7 @@ use ILIAS\Language\ComponentTranslation\TranslationGettextRepository; use ILIAS\Language\ComponentTranslation\TranslationRepository; use ILIAS\Language\LanguageIdentifier; +use ILIAS\components\Logging\NullLogger; /** * language handling @@ -112,7 +113,9 @@ public function __construct(string $a_lang_key, ?TranslationRepository $translat $this->translations = $translations; $client_ini = $DIC->clientIni(); - $this->log = $DIC->logger()->forComponent('lang'); + $this->log = isset($DIC['ilLoggerFactory'], $DIC['logging.factory']) + ? $DIC->logger()->forComponent('lang') + : new NullLogger(); $this->lang_key = $a_lang_key;