|
ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
language handling More...
Inheritance diagram for ilLanguage:
Collaboration diagram for ilLanguage:Public Member Functions | |
| __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, ilTemplate $a_tpl=null) | |
| toJSMap ($a_map, ilTemplate $a_tpl=null) | |
| Transfer text to Javascript. More... | |
| __destruct () | |
| destructor saves all language usages to db if log is enabled and ilDB exists More... | |
| __construct ($a_lang_key) | |
| Constructor read the single-language file and put this in an array text. More... | |
| txt ($a_topic) | |
| 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... | |
| 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... | |
| getLocalLanguages () | |
| Searches for the existence of *.lang.local files. More... | |
| getInstallableLanguages () | |
| setDbHandler ($a_db_handler) | |
| set db handler object @string object db handler More... | |
| loadLanguageModule () | |
Static Public Member Functions | |
| static | _getInstalledLanguages () |
| static | _lookupEntry ($a_lang_key, $a_mod, $a_id) |
| static | lookupId ($a_lang_key) |
| Lookup obj_id of language @global ilDB $ilDB. More... | |
| static | getFallbackInstance () |
| Builds a global default language instance. More... | |
| static | getGlobalInstance () |
| Builds the global language object. More... | |
| 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... | |
Data Fields | |
| $ilias | |
| $text = array() | |
| $lang_default = "en" | |
| $lang_user | |
| $lang_path | |
| $lang_key | |
| $lang_name | |
| $separator = "#:#" | |
| $comment_separator = "###" | |
| $loaded_modules | |
Static Protected Member Functions | |
| 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... | |
Protected Attributes | |
| $cached_modules = array() | |
| $map_modules_txt = array() | |
| $usage_log_enabled = false | |
Static Protected Attributes | |
| static | $used_topics = array() |
| static | $used_modules = array() |
| static | $lng_log = array() |
language handling
language handling for setup
this class offers the language handling for an application. it works initially on one file: languages.txt from this file the class can generate many single language files. 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
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
Definition at line 26 of file class.ilLanguage.php.
| ilLanguage::__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.
@access public
| string | languagecode (two characters), e.g. "de", "en", "in" |
Definition at line 154 of file class.ilLanguage.php.
References $DIC, $ilIliasIniFile, $ilSetting, $ilUser, $lang_default, getInstalledLanguages(), ilCachedLanguage\getInstance(), isUsageLogEnabled(), and loadLanguageModule().
Here is the call graph for this function:| ilLanguage::__destruct | ( | ) |
destructor saves all language usages to db if log is enabled and ilDB exists
Definition at line 594 of file class.ilLanguage.php.
| ilLanguage::__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. @access public
| string | languagecode (two characters), e.g. "de", "en", "in" |
Definition at line 100 of file class.ilLanguage.php.
|
static |
Delete languge data.
| string | lang key |
Definition at line 466 of file class.ilLanguage.php.
References $ilDB.
Referenced by flushLanguage().
Here is the caller graph for this function:
|
static |
Definition at line 350 of file class.ilLanguage.php.
References $lang, $languages, and ilObject\_getObjectsByType().
Referenced by ilLanguageDetection\detect(), getGlobalInstance(), and getInstalledLanguages().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 364 of file class.ilLanguage.php.
References $DIC, $ilDB, and logUsage().
Referenced by ilLinkChecker\__txt(), ilObjLTIAdministrationGUI\getConsumerForm(), ilPersonalSettingsGUI\initGeneralSettingsForm(), ilAccountMail\replacePlaceholders(), txt(), ilUserCronCheckAccounts\txt(), and txtlng().
Here is the call graph for this function:
Here is the caller graph for this function:| ilLanguage::checkLanguage | ( | $a_lang_key, | |
$scope = '' |
|||
| ) |
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 372 of file class.ilLanguage.php.
References $key, $lang_path, $path, and cut_header().
Referenced by installLanguages().
Here is the call graph for this function:
Here is the caller graph for this function:| ilLanguage::cut_header | ( | $content | ) |
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 432 of file class.ilLanguage.php.
References $key.
Referenced by checkLanguage(), and insertLanguage().
Here is the caller graph for this function:| ilLanguage::exists | ( | $a_topic | ) |
Check if language entry exists.
| object | $a_topic |
Definition at line 289 of file class.ilLanguage.php.
| ilLanguage::flushLanguage | ( | $a_lang_key, | |
$a_mode = 'all' |
|||
| ) |
remove language data from database
| string | language key |
| string | "all" or "keep_local" |
Definition at line 449 of file class.ilLanguage.php.
References $ilDB, and _deleteLangData().
Referenced by installLanguages().
Here is the call graph for this function:
Here is the caller graph for this function:| ilLanguage::getAvailableLanguages | ( | ) |
get already registered languages (in db)
Definition at line 343 of file class.ilLanguage.php.
References $ilDB, $query, $r, and $row.
Referenced by installLanguages().
Here is the caller graph for this function:| ilLanguage::getDefaultLanguage | ( | ) |
Definition at line 206 of file class.ilLanguage.php.
|
static |
Builds a global default language instance.
Definition at line 437 of file class.ilLanguage.php.
|
static |
Builds the global language object.
Definition at line 446 of file class.ilLanguage.php.
References $_GET, $_POST, $DIC, $ilSetting, $ilUser, $language, _getInstalledLanguages(), ilSession\get(), ilSession\set(), and ilUtil\stripSlashes().
Here is the call graph for this function:| ilLanguage::getInstallableLanguages | ( | ) |
Definition at line 747 of file class.ilLanguage.php.
References $d, $lang_key, and getLanguages().
Here is the call graph for this function:| ilLanguage::getInstalledLanguages | ( | ) |
Definition at line 345 of file class.ilLanguage.php.
References _getInstalledLanguages().
Referenced by __construct().
Here is the call graph for this function:
Here is the caller graph for this function:| ilLanguage::getInstalledLanguages | ( | ) |
get already installed languages (in db)
Definition at line 298 of file class.ilLanguage.php.
| ilLanguage::getInstalledLocalLanguages | ( | ) |
get already installed local languages (in db)
Definition at line 321 of file class.ilLanguage.php.
| ilLanguage::getLangKey | ( | ) |
Definition at line 201 of file class.ilLanguage.php.
References $lang_key.
| ilLanguage::getLanguages | ( | ) |
get all setup languages in the system
the functions looks for setup*.lang-files in the languagedirectory @access public
Definition at line 178 of file class.ilLanguage.php.
References $d, $lang_key, and $languages.
Referenced by getInstallableLanguages().
Here is the caller graph for this function:| ilLanguage::getLocalChanges | ( | $a_lang_key, | |
$a_min_date = "", |
|||
$a_max_date = "" |
|||
| ) |
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 487 of file class.ilLanguage.php.
References $ilDB, $result, $row, and ilDBConstants\FETCHMODE_ASSOC.
Referenced by insertLanguage().
Here is the caller graph for this function:| ilLanguage::getLocalLanguages | ( | ) |
Searches for the existence of *.lang.local files.
return $local_langs array of language keys
Definition at line 725 of file class.ilLanguage.php.
| ilLanguage::getUsedModules | ( | ) |
Definition at line 422 of file class.ilLanguage.php.
References $used_modules.
| ilLanguage::getUsedTopics | ( | ) |
Definition at line 416 of file class.ilLanguage.php.
References $used_topics.
| ilLanguage::getUserLanguage | ( | ) |
| ilLanguage::insertLanguage | ( | $lang_key, | |
$scope = '' |
|||
| ) |
insert language data from file in database
| string | $lang_key | international language key (2 digits) |
| string | $scope | empty (global) or "local" |
Definition at line 523 of file class.ilLanguage.php.
References $ilDB, $key, $lang_key, $lang_path, $module, $path, $row, cut_header(), getLocalChanges(), replaceLangEntry(), replaceLangModule(), and updateLangEntry().
Referenced by installLanguages().
Here is the call graph for this function:
Here is the caller graph for this function:| ilLanguage::installLanguages | ( | $a_lang_keys, | |
| $a_local_keys | |||
| ) |
install languages
| array | array with lang_keys of languages to install |
Definition at line 203 of file class.ilLanguage.php.
References $ilDB, $key, $lang_key, $ld, $query, checkLanguage(), flushLanguage(), getAvailableLanguages(), and insertLanguage().
Here is the call graph for this function:
|
staticprotected |
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
Definition at line 571 of file class.ilLanguage.php.
Referenced by __construct().
Here is the caller graph for this function:| ilLanguage::loadLanguageModule | ( | $a_module | ) |
Reimplemented in ilLanguageMock.
Definition at line 294 of file class.ilLanguage.php.
References $DIC, $ilDB, $key, $lang_key, $lang_user, $r, $row, and ilDBConstants\FETCHMODE_ASSOC.
| ilLanguage::loadLanguageModule | ( | ) |
Definition at line 786 of file class.ilLanguage.php.
Referenced by __construct().
Here is the caller graph for this function:
|
staticprotected |
saves tupel of language module and identifier
| string | $a_module | |
| string | $a_identifier |
Definition at line 556 of file class.ilLanguage.php.
Referenced by _lookupEntry(), and txt().
Here is the caller graph for this function:
|
static |
Lookup obj_id of language @global ilDB $ilDB.
| string | $a_lang_key |
Definition at line 399 of file class.ilLanguage.php.
References $DIC, $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.
Referenced by ilStartUpGUI\getLoginPageEditorHTML(), and ilAuthLoginPageEditorTableGUI\parse().
Here is the caller graph for this function:
|
staticfinal |
Replace lang entry.
Definition at line 665 of file class.ilLanguage.php.
References $ilDB.
Referenced by insertLanguage().
Here is the caller graph for this function:
|
staticfinal |
Replace language module array.
Definition at line 642 of file class.ilLanguage.php.
References $ilDB.
Referenced by insertLanguage().
Here is the caller graph for this function:| ilLanguage::setDbHandler | ( | $a_db_handler | ) |
set db handler object @string object db handler
Definition at line 775 of file class.ilLanguage.php.
| ilLanguage::toJS | ( | $a_lang_key, | |
| ilTemplate | $a_tpl = null |
||
| ) |
Reimplemented in ilLanguageMock.
Definition at line 503 of file class.ilLanguage.php.
References $DIC, $map, $tpl, toJSMap(), and txt().
Here is the call graph for this function:| ilLanguage::toJSMap | ( | $a_map, | |
| ilTemplate | $a_tpl = null |
||
| ) |
Transfer text to Javascript.
| array | $a_map | array of key value pairs (key is text string, value is content) |
| ilTemplate | $a_tpl | template |
Definition at line 529 of file class.ilLanguage.php.
References $DIC, $tpl, and ilJsonUtil\encode().
Referenced by toJS().
Here is the call graph for this function:
Here is the caller graph for this function:| ilLanguage::txt | ( | $a_topic | ) |
gets the text for a given topic
if the topic is not in the list, the topic itself with "-" will be returned @access public
| string | topic |
Definition at line 145 of file class.ilLanguage.php.
References $log.
| ilLanguage::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
@access public
| string | topic |
Reimplemented in ilLanguageMock.
Definition at line 237 of file class.ilLanguage.php.
References _lookupEntry(), and logUsage().
Referenced by toJS(), and txtlng().
Here is the call graph for this function:
Here is the caller graph for this function:| ilLanguage::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
@access public
| string | topic | |
| string | $a_language | The language of the output string |
Definition at line 220 of file class.ilLanguage.php.
References _lookupEntry(), and txt().
Here is the call graph for this function:
|
staticfinal |
Update lang entry.
Definition at line 699 of file class.ilLanguage.php.
References $ilDB.
Referenced by insertLanguage().
Here is the caller graph for this function:
|
protected |
Definition at line 127 of file class.ilLanguage.php.
| ilLanguage::$comment_separator = "###" |
Definition at line 103 of file class.ilLanguage.php.
| ilLanguage::$ilias |
Definition at line 34 of file class.ilLanguage.php.
| ilLanguage::$lang_default = "en" |
Definition at line 51 of file class.ilLanguage.php.
Referenced by __construct().
| ilLanguage::$lang_key |
Definition at line 79 of file class.ilLanguage.php.
Referenced by getInstallableLanguages(), getLangKey(), getLanguages(), getLocalLanguages(), insertLanguage(), installLanguages(), and loadLanguageModule().
| ilLanguage::$lang_name |
Definition at line 87 of file class.ilLanguage.php.
| ilLanguage::$lang_path |
Definition at line 71 of file class.ilLanguage.php.
Referenced by checkLanguage(), and insertLanguage().
| ilLanguage::$lang_user |
Definition at line 61 of file class.ilLanguage.php.
Referenced by getUserLanguage(), and loadLanguageModule().
|
staticprotected |
Definition at line 142 of file class.ilLanguage.php.
| ilLanguage::$loaded_modules |
Definition at line 111 of file class.ilLanguage.php.
|
protected |
Definition at line 132 of file class.ilLanguage.php.
| ilLanguage::$separator = "#:#" |
Definition at line 95 of file class.ilLanguage.php.
| ilLanguage::$text = array() |
Definition at line 42 of file class.ilLanguage.php.
|
protected |
Definition at line 137 of file class.ilLanguage.php.
|
staticprotected |
Definition at line 123 of file class.ilLanguage.php.
Referenced by getUsedModules().
|
staticprotected |
Definition at line 117 of file class.ilLanguage.php.
Referenced by getUsedTopics().