ILIAS
release_6 Revision v6.24-5-g0c8bfefb3b8
|
language handling for setup 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... | |
getLanguages () | |
get all setup languages in the system 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... | |
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 () | |
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 | replaceLangModule ($a_key, $a_module, $a_array) |
Replace language module array. More... | |
static | replaceLangEntry ( $a_module, $a_identifier, $a_lang_key, $a_value, $a_local_change=null) |
Replace lang entry. More... | |
static | updateLangEntry ( $a_module, $a_identifier, $a_lang_key, $a_value, $a_local_change=null) |
Update lang entry. 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 | |
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... | |
getLocalChanges ($a_lang_key, $a_min_date="", $a_max_date="") | |
get locally changed language entries More... | |
insertLanguage ($lang_key, $scope='') | |
insert language data from file in database More... | |
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... | |
![]() | |
$cached_modules = array() | |
$map_modules_txt = array() | |
$usage_log_enabled = false | |
![]() | |
static | $used_topics = array() |
static | $used_modules = array() |
static | $lng_log = array() |
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 47 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 | languagecode (two characters), e.g. "de", "en", "in" |
Definition at line 103 of file class.ilSetupLanguage.php.
References Vendor\Package\$a, and $txt.
|
static |
Delete languge data.
string | lang key |
Definition at line 476 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 381 of file class.ilSetupLanguage.php.
References $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.
string | $content | expect an ILIAS lang-file |
Definition at line 442 of file class.ilSetupLanguage.php.
Referenced by checkLanguage(), and insertLanguage().
|
protected |
remove language data from database
string | language key |
string | "all" or "keep_local" |
Definition at line 459 of file class.ilSetupLanguage.php.
References $ilDB, and _deleteLangData().
Referenced by installLanguages().
|
protected |
get already registered languages (in db)
Definition at line 352 of file class.ilSetupLanguage.php.
Referenced by installLanguages().
ilSetupLanguage::getInstallableLanguages | ( | ) |
Definition at line 762 of file class.ilSetupLanguage.php.
References $d, $lang_key, and getLanguages().
ilSetupLanguage::getInstalledLanguages | ( | ) |
get already installed languages (in db)
Definition at line 307 of file class.ilSetupLanguage.php.
ilSetupLanguage::getInstalledLocalLanguages | ( | ) |
get already installed local languages (in db)
Definition at line 330 of file class.ilSetupLanguage.php.
ilSetupLanguage::getLanguages | ( | ) |
get all setup languages in the system
the functions looks for setup*.lang-files in the languagedirectory public
Definition at line 187 of file class.ilSetupLanguage.php.
Referenced by getInstallableLanguages().
|
protected |
get locally changed language entries
string | language key |
string | minimum change date "yyyy-mm-dd hh:mm:ss" |
string | maximum change date "yyyy-mm-dd hh:mm:ss" |
Definition at line 497 of file class.ilSetupLanguage.php.
References $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 740 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 533 of file class.ilSetupLanguage.php.
References $ilDB, $lang_key, $lang_path, cut_header(), getLocalChanges(), replaceLangEntry(), replaceLangModule(), and updateLangEntry().
Referenced by installLanguages().
ilSetupLanguage::installLanguages | ( | $a_lang_keys, | |
$a_local_keys | |||
) |
install languages
array | array with lang_keys of languages to install |
Definition at line 212 of file class.ilSetupLanguage.php.
References $ilDB, $lang_key, $query, checkLanguage(), flushLanguage(), getAvailableLanguages(), and insertLanguage().
ilSetupLanguage::loadLanguageModule | ( | $a_module | ) |
Definition at line 801 of file class.ilSetupLanguage.php.
|
staticfinal |
Replace lang entry.
Definition at line 680 of file class.ilSetupLanguage.php.
References $ilDB.
Referenced by insertLanguage().
|
staticfinal |
Replace language module array.
Definition at line 657 of file class.ilSetupLanguage.php.
References $ilDB.
Referenced by insertLanguage().
ilSetupLanguage::setDbHandler | ( | $a_db_handler | ) |
set db handler object object db handler
Definition at line 790 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 | topic |
Definition at line 154 of file class.ilSetupLanguage.php.
References $log.
|
staticfinal |
Update lang entry.
Definition at line 714 of file class.ilSetupLanguage.php.
References $ilDB.
Referenced by insertLanguage().
ilSetupLanguage::$comment_separator = "###" |
Definition at line 92 of file class.ilSetupLanguage.php.
ilSetupLanguage::$lang_default = "en" |
Definition at line 62 of file class.ilSetupLanguage.php.
ilSetupLanguage::$lang_key |
Definition at line 78 of file class.ilSetupLanguage.php.
Referenced by getInstallableLanguages(), getLanguages(), getLocalLanguages(), insertLanguage(), and installLanguages().
ilSetupLanguage::$lang_path |
Definition at line 71 of file class.ilSetupLanguage.php.
Referenced by checkLanguage(), and insertLanguage().
ilSetupLanguage::$separator = "#:#" |
Definition at line 85 of file class.ilSetupLanguage.php.
ilSetupLanguage::$text = array() |
Definition at line 54 of file class.ilSetupLanguage.php.