ILIAS  release_8 Revision v8.24
class.ilLanguageFactory.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
31{
32 private static array $languages = array();
33
37 public static function _getLanguage(string $a_lang_key = ''): ilLanguage
38 {
39 global $DIC;
40 $lng = $DIC->language();
41
42 if (!$a_lang_key) {
43 if (is_object($lng)) {
44 $a_lang_key = $lng->getDefaultLanguage();
45 } else {
46 $a_lang_key = "en";
47 }
48 }
49
50 return self::$languages[$a_lang_key] ?? (self::$languages[$a_lang_key] = new ilLanguage($a_lang_key));
51 }
52
57 public static function _getLanguageOfUser(int $a_usr_id): ilLanguage
58 {
60 }
61}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getLanguageOfUser(int $a_usr_id)
Get language object of user.
static _getLanguage(string $a_lang_key='')
Get language object.
language handling
static _lookupLanguage(int $a_usr_id)
global $DIC
Definition: feed.php:28
$lng