19 declare(strict_types=1);
41 $ilLog = $DIC->logger()->lang();
44 $detected_language = $installed_languages[0];
46 foreach ($this->
factory->getValidInstances() as $detector) {
48 $language = $detector->getIso2LanguageCode();
49 if (in_array($language, $installed_languages,
true)) {
50 $detected_language = $language;
53 $ilLog->warning($e->getMessage());
57 return $detected_language;
ilLanguageDetectorFactory $factory
Class ilLanguageDetectorFactory.
Class for language related exception handling in ILIAS.
Class ilLanguageDetection.
detect()
Return detected language.
static _getInstalledLanguages()
Get installed languages.