3 declare(strict_types=1);
22 require_once
"Services/Language/classes/class.ilLanguage.php";
23 require_once
"Services/Language/classes/class.ilLanguageDetectorFactory.php";
45 $ilLog = $DIC->logger()->lang();
48 $detected_language = $installed_languages[0];
50 foreach ($this->factory->getValidInstances() as $detector) {
52 $language = $detector->getIso2LanguageCode();
53 if (in_array($language, $installed_languages,
true)) {
54 $detected_language = $language;
57 $ilLog->warning($e->getMessage());
61 return $detected_language;
ilLanguageDetectorFactory $factory
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
detect()
Return detected language.
static _getInstalledLanguages()
Get installed languages.