ILIAS
release_7 Revision v7.30-3-g800a261c036
|
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...
Public Member Functions | |
__construct ($a_lang_key) | |
Constructor read the single-language file and put this in an array text. More... | |
txt ($a_topic, $a_default_lang_fallback_mod='') | |
gets the text for a given topic More... | |
installLanguages ($a_lang_keys, $a_local_keys) | |
install languages More... | |
getInstalledLanguages () | |
get already installed languages (in db) More... | |
getInstalledLocalLanguages () | |
get already installed local languages (in db) More... | |
getLocalChanges ($a_lang_key, $a_min_date="", $a_max_date="") | |
get locally changed language entries More... | |
getLocalLanguages () | |
Searches for the existence of *.lang.local files. More... | |
getInstallableLanguages () | |
setDbHandler ($a_db_handler) | |
set db handler object object db handler More... | |
loadLanguageModule ($a_module) | |
![]() | |
__construct ($a_lang_key) | |
Constructor read the single-language file and put this in an array text. More... | |
getLangKey () | |
getDefaultLanguage () | |
getTextDirection () | |
getContentLanguage () | |
txtlng ($a_module, $a_topic, $a_language) | |
gets the text for a given topic in a given language if the topic is not in the list, the topic itself with "-" will be returned More... | |
txt ($a_topic, $a_default_lang_fallback_mod="") | |
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be returned More... | |
exists ($a_topic) | |
Check if language entry exists. More... | |
loadLanguageModule ($a_module) | |
getInstalledLanguages () | |
getUsedTopics () | |
getUsedModules () | |
getUserLanguage () | |
toJS ($a_lang_key, ilGlobalTemplateInterface $a_tpl=null) | |
toJSMap ($a_map, ilGlobalTemplateInterface $a_tpl=null) | |
Transfer text to Javascript. More... | |
__destruct () | |
destructor saves all language usages to db if log is enabled and ilDB exists More... | |
Static Public Member Functions | |
static | _deleteLangData ($a_lang_key, $a_keep_local_change) |
Delete languge data. More... | |
![]() | |
static | _getInstalledLanguages () |
static | _lookupEntry ($a_lang_key, $a_mod, $a_id) |
static | lookupId ($a_lang_key) |
Lookup obj_id of language ilDB $ilDB. More... | |
static | getFallbackInstance () |
Builds a global default language instance. More... | |
static | getGlobalInstance () |
Builds the global language object. More... | |
Data Fields | |
$text = array() | |
$lang_default = "en" | |
$lang_path | |
$lang_key | |
$separator = "#:#" | |
$comment_separator = "###" | |
![]() | |
$ilias | |
$text | |
$lang_default | |
$lang_user | |
$lang_path | |
$lang_key | |
$lang_name | |
$separator = "#:#" | |
$comment_separator = "###" | |
$loaded_modules | |
$cust_lang_path | |
Protected Member Functions | |
getAvailableLanguages () | |
get already registered languages (in db) More... | |
checkLanguage ($a_lang_key, $scope='') | |
validate the logical structure of a lang-file More... | |
cut_header ($content) | |
Remove *.lang header information from '$content'. More... | |
flushLanguage ($a_lang_key, $a_mode='all') | |
remove language data from database More... | |
insertLanguage ($lang_key, $scope='') | |
insert language data from file in database More... | |
Protected Attributes | |
$db | |
![]() | |
$cached_modules = array() | |
$map_modules_txt = array() | |
$usage_log_enabled = false | |
$log | |
$global_cache | |
Additional Inherited Members | |
![]() | |
static | logUsage ($a_module, $a_identifier) |
saves tupel of language module and identifier More... | |
static | isUsageLogEnabled () |
checks if language usage log is enabled you need MySQL to use this function this function is automatically enabled if DEVMODE is on this function is also enabled if language_log is 1 More... | |
![]() | |
static | $used_topics = array() |
static | $used_modules = array() |
static | $lng_log = array() |
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.
If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning language handling for setup
this class offers the language handling for an application. the constructor is called with a small language abbreviation e.g. $lng = new Language("en"); the constructor reads the single-languagefile en.lang and puts this into an array. with e.g. $lng->txt("user_updated"); you can translate a lang-topic into the actual language
The DATE field is not set correctly on changes of a language (update, install, your stable). The format functions do not belong in class.Language. Those are also applicable elsewhere. Therefore, they would be better placed in class.Format
This somehow needs to be reconciled with the base class and most probably be factored into two classes, one for management, one for retrieval.
Definition at line 43 of file class.ilSetupLanguage.php.
ilSetupLanguage::__construct | ( | $a_lang_key | ) |
Constructor read the single-language file and put this in an array text.
the text array is two-dimensional. First dimension is the language. Second dimension is the languagetopic. Content is the translation. public
string | $a_lang_key | languagecode (two characters), e.g. "de", "en", "in" |
Definition at line 100 of file class.ilSetupLanguage.php.
References $lang_default.
|
static |
Delete languge data.
string | $a_lang_key | lang key |
Definition at line 412 of file class.ilSetupLanguage.php.
References $ilDB.
Referenced by flushLanguage().
|
protected |
validate the logical structure of a lang-file
This function checks if a lang-file of a given lang_key exists, the file has a header, and each lang-entry consists of exactly three elements (module, identifier, value).
string | $a_lang_key | international language key (2 digits) |
string | $scope | empty (global) or "local" |
Definition at line 317 of file class.ilSetupLanguage.php.
References ilLanguage\$cust_lang_path, $lang_path, and cut_header().
Referenced by installLanguages().
|
protected |
Remove *.lang header information from '$content'.
This function seeks for a special keyword where the language information starts. If found it returns the plain language information; otherwise returns false.
array | $content | expect an ILIAS lang-file |
Definition at line 378 of file class.ilSetupLanguage.php.
Referenced by checkLanguage(), and insertLanguage().
|
protected |
remove language data from database
string | $a_lang_key | language key |
string | $a_mode | "all" or "keep_local" |
Definition at line 395 of file class.ilSetupLanguage.php.
References $db, $ilDB, and _deleteLangData().
Referenced by installLanguages().
|
protected |
get already registered languages (in db)
Definition at line 288 of file class.ilSetupLanguage.php.
Referenced by installLanguages().
ilSetupLanguage::getInstallableLanguages | ( | ) |
Definition at line 633 of file class.ilSetupLanguage.php.
ilSetupLanguage::getInstalledLanguages | ( | ) |
get already installed languages (in db)
Definition at line 243 of file class.ilSetupLanguage.php.
ilSetupLanguage::getInstalledLocalLanguages | ( | ) |
get already installed local languages (in db)
Definition at line 266 of file class.ilSetupLanguage.php.
ilSetupLanguage::getLocalChanges | ( | $a_lang_key, | |
$a_min_date = "" , |
|||
$a_max_date = "" |
|||
) |
get locally changed language entries
string | $a_lang_key | language key |
string | $a_min_date | minimum change date "yyyy-mm-dd hh:mm:ss" |
string | $a_max_date | maximum change date "yyyy-mm-dd hh:mm:ss" |
Definition at line 433 of file class.ilSetupLanguage.php.
References $db, $ilDB, $result, and ilDBConstants\FETCHMODE_ASSOC.
Referenced by insertLanguage().
ilSetupLanguage::getLocalLanguages | ( | ) |
Searches for the existence of *.lang.local files.
return $local_langs array of language keys
Definition at line 611 of file class.ilSetupLanguage.php.
|
protected |
insert language data from file in database
string | $lang_key | international language key (2 digits) |
string | $scope | empty (global) or "local" |
Definition at line 469 of file class.ilSetupLanguage.php.
References ilLanguage\$cust_lang_path, $db, $ilDB, $lang_key, $lang_path, $query, cut_header(), and getLocalChanges().
Referenced by installLanguages().
ilSetupLanguage::installLanguages | ( | $a_lang_keys, | |
$a_local_keys | |||
) |
install languages
array | $a_lang_keys | array with lang_keys of languages to install |
Definition at line 148 of file class.ilSetupLanguage.php.
References $ilDB, $lang_key, $query, checkLanguage(), flushLanguage(), getAvailableLanguages(), and insertLanguage().
ilSetupLanguage::loadLanguageModule | ( | $a_module | ) |
Definition at line 669 of file class.ilSetupLanguage.php.
ilSetupLanguage::setDbHandler | ( | $a_db_handler | ) |
set db handler object object db handler
Definition at line 658 of file class.ilSetupLanguage.php.
ilSetupLanguage::txt | ( | $a_topic, | |
$a_default_lang_fallback_mod = '' |
|||
) |
gets the text for a given topic
if the topic is not in the list, the topic itself with "-" will be returned public
string | $a_topic | topic |
Definition at line 116 of file class.ilSetupLanguage.php.
References ilLanguage\$log.
ilSetupLanguage::$comment_separator = "###" |
Definition at line 88 of file class.ilSetupLanguage.php.
|
protected |
Definition at line 90 of file class.ilSetupLanguage.php.
Referenced by flushLanguage(), getLocalChanges(), and insertLanguage().
ilSetupLanguage::$lang_default = "en" |
Definition at line 58 of file class.ilSetupLanguage.php.
Referenced by __construct().
ilSetupLanguage::$lang_key |
Definition at line 74 of file class.ilSetupLanguage.php.
Referenced by getInstallableLanguages(), getLocalLanguages(), insertLanguage(), and installLanguages().
ilSetupLanguage::$lang_path |
Definition at line 67 of file class.ilSetupLanguage.php.
Referenced by checkLanguage(), and insertLanguage().
ilSetupLanguage::$separator = "#:#" |
Definition at line 81 of file class.ilSetupLanguage.php.
ilSetupLanguage::$text = array() |
Definition at line 50 of file class.ilSetupLanguage.php.