|
ILIAS
release_9 Revision v9.13-25-g2c18ec4c24f
|
language handling for setup More...
Inheritance diagram for ilSetupLanguage:
Collaboration diagram for ilSetupLanguage:Public Member Functions | |
| __construct (string $a_lang_key) | |
| txt (string $a_topic, string $a_default_lang_fallback_mod='') | |
| gets the text for a given topic More... | |
| installLanguages (array $a_lang_keys, array $a_local_keys) | |
| install languages More... | |
| getInstalledLanguages () | |
| get already installed languages (in db) More... | |
| getInstalledLocalLanguages () | |
| get already installed local languages (in db) More... | |
| getLocalChanges (string $a_lang_key, string $a_min_date="", string $a_max_date="") | |
| get locally changed language entries $a_lang_key language key $a_min_date minimum change date "yyyy-mm-dd hh:mm:ss" $a_max_date maximum change date "yyyy-mm-dd hh:mm:ss" Returned value [module][identifier] => value More... | |
| getLocalLanguages () | |
| Searches for the existence of *.lang.local files. More... | |
| getInstallableLanguages () | |
| Return installable languages. More... | |
| setDbHandler (ilDBInterface $a_db_handler) | |
| set db handler object object db handler Return true on success More... | |
| loadLanguageModule (string $a_module) | |
Public Member Functions inherited from ilLanguage | |
| __construct (string $a_lang_key) | |
| Constructor read the single-language file and put this in an array text. More... | |
| getLangKey () | |
| Return lang key. More... | |
| getDefaultLanguage () | |
| Return default language. More... | |
| getTextDirection () | |
| Return text direction. More... | |
| getContentLanguage () | |
| Return content language. More... | |
| txtlng (string $a_module, string $a_topic, string $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 (string $a_topic, string $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 (string $a_topic) | |
| Check if language entry exists. More... | |
| loadLanguageModule (string $a_module) | |
| Load language module. More... | |
| getInstalledLanguages () | |
| Get installed languages. More... | |
| getUsedTopics () | |
| Return used topics. More... | |
| getUsedModules () | |
| Return used modules. More... | |
| getUserLanguage () | |
| Return language of user. More... | |
| getCustomLangPath () | |
| toJS ($a_lang_key, ilGlobalTemplateInterface $a_tpl=null) | |
| Transfer text to Javascript. More... | |
| toJSMap (array $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 (string $a_lang_key, bool $a_keep_local_change) |
| Delete languge data. More... | |
Static Public Member Functions inherited from ilLanguage | |
| static | _getInstalledLanguages () |
| Get installed languages. More... | |
| static | _lookupEntry (string $a_lang_key, string $a_mod, string $a_id) |
| static | lookupId (string $a_lang_key) |
| Lookup obj_id of language. More... | |
| static | getFallbackInstance () |
| Builds a global default language instance. More... | |
| static | getGlobalInstance () |
| Builds the global language object. More... | |
Data Fields | |
| array | $text |
| string | $lang_default = "en" |
| string | $lang_path |
| string | $lang_key |
| string | $separator = "#:#" |
| string | $comment_separator = "###" |
Data Fields inherited from ilLanguage | |
| ILIAS | $ilias |
| array | $text = [] |
| string | $lang_default |
| string | $lang_user |
| string | $lang_path |
| string | $lang_key |
| string | $lang_name |
| string | $separator = "#:#" |
| string | $comment_separator = "###" |
| array | $loaded_modules = array() |
Protected Member Functions | |
| getAvailableLanguages () | |
| get already registered languages (in db) More... | |
| checkLanguage (string $a_lang_key, string $scope="") | |
| validate the logical structure of a lang-file More... | |
| cut_header (array $content) | |
| Remove *.lang header information from '$content'. More... | |
| flushLanguage (string $a_lang_key, string $a_mode="all") | |
| remove language data from database $a_lang_key language key $a_mode "all" or "keep_local" More... | |
| insertLanguage (string $lang_key, string $scope="") | |
| insert language data from file in database More... | |
Protected Attributes | |
| ilDBInterface | $db |
Protected Attributes inherited from ilLanguage | |
| array | $cached_modules = array() |
| array | $map_modules_txt = array() |
| bool | $usage_log_enabled = false |
| string | $cust_lang_path |
| ilLogger | $log |
| ilCachedLanguage | $global_cache |
Additional Inherited Members | |
Static Protected Member Functions inherited from ilLanguage | |
| static | logUsage (string $a_module, string $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 Protected Attributes inherited from ilLanguage | |
| static array | $used_topics = array() |
| static array | $used_modules = array() |
| static array | $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 43 of file class.ilSetupLanguage.php.
| ilSetupLanguage::__construct | ( | string | $a_lang_key | ) |
|
static |
Delete languge data.
$a_lang_key lang key
Definition at line 356 of file class.ilSetupLanguage.php.
References $ilDB.
|
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).
$a_lang_key international language key (2 digits) $scope empty (global) or "local" $info_text message about results of check OR "1" if all checks successfully passed
Definition at line 263 of file class.ilSetupLanguage.php.
References ilLanguage\$cust_lang_path, ILIAS\LTI\ToolProvider\$key, $lang_path, $path, $scope, and cut_header().
Referenced by installLanguages().
Here is the call graph for this function:
Here is the caller graph for this function:
|
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.
$content expect an ILIAS lang-file
Definition at line 324 of file class.ilSetupLanguage.php.
References ILIAS\LTI\ToolProvider\$key.
Referenced by checkLanguage(), and insertLanguage().
Here is the caller graph for this function:
|
protected |
remove language data from database $a_lang_key language key $a_mode "all" or "keep_local"
Definition at line 339 of file class.ilSetupLanguage.php.
References $ilDB.
Referenced by installLanguages().
Here is the caller graph for this function:
|
protected |
get already registered languages (in db)
Definition at line 234 of file class.ilSetupLanguage.php.
Referenced by installLanguages().
Here is the caller graph for this function:| ilSetupLanguage::getInstallableLanguages | ( | ) |
Return installable languages.
Definition at line 579 of file class.ilSetupLanguage.php.
References Vendor\Package\$d, and $lang_key.
| ilSetupLanguage::getInstalledLanguages | ( | ) |
| ilSetupLanguage::getInstalledLocalLanguages | ( | ) |
get already installed local languages (in db)
Definition at line 214 of file class.ilSetupLanguage.php.
| ilSetupLanguage::getLocalChanges | ( | string | $a_lang_key, |
| string | $a_min_date = "", |
||
| string | $a_max_date = "" |
||
| ) |
get locally changed language entries $a_lang_key language key $a_min_date minimum change date "yyyy-mm-dd hh:mm:ss" $a_max_date maximum change date "yyyy-mm-dd hh:mm:ss" Returned value [module][identifier] => value
Definition at line 377 of file class.ilSetupLanguage.php.
References $ilDB, $q, and ilDBConstants\FETCHMODE_ASSOC.
Referenced by insertLanguage().
Here is the caller graph for this function:| ilSetupLanguage::getLocalLanguages | ( | ) |
Searches for the existence of *.lang.local files.
Returns array with language keys
Definition at line 554 of file class.ilSetupLanguage.php.
References Vendor\Package\$d, and $lang_key.
|
protected |
insert language data from file in database
$lang_key international language key (2 digits) $scope empty (global) or "local"
Definition at line 412 of file class.ilSetupLanguage.php.
References ilLanguage\$cust_lang_path, $ilDB, ILIAS\LTI\ToolProvider\$key, $lang_path, $path, $q, $scope, cut_header(), and getLocalChanges().
Referenced by installLanguages().
Here is the call graph for this function:
Here is the caller graph for this function:| ilSetupLanguage::installLanguages | ( | array | $a_lang_keys, |
| array | $a_local_keys | ||
| ) |
install languages
$a_lang_keys array with lang_keys of languages to install
Definition at line 101 of file class.ilSetupLanguage.php.
References $ilDB, ILIAS\LTI\ToolProvider\$key, $lang_key, checkLanguage(), flushLanguage(), getAvailableLanguages(), and insertLanguage().
Here is the call graph for this function:| ilSetupLanguage::loadLanguageModule | ( | string | $a_module | ) |
Definition at line 610 of file class.ilSetupLanguage.php.
| ilSetupLanguage::setDbHandler | ( | ilDBInterface | $a_db_handler | ) |
set db handler object object db handler Return true on success
Definition at line 604 of file class.ilSetupLanguage.php.
| ilSetupLanguage::txt | ( | string | $a_topic, |
| string | $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
$a_topic topic
Definition at line 68 of file class.ilSetupLanguage.php.
References ilLanguage\$log.
| string ilSetupLanguage::$comment_separator = "###" |
Definition at line 50 of file class.ilSetupLanguage.php.
|
protected |
Definition at line 51 of file class.ilSetupLanguage.php.
| string ilSetupLanguage::$lang_default = "en" |
Definition at line 46 of file class.ilSetupLanguage.php.
Referenced by __construct().
| string ilSetupLanguage::$lang_key |
Definition at line 48 of file class.ilSetupLanguage.php.
Referenced by getInstallableLanguages(), getLocalLanguages(), and installLanguages().
| string ilSetupLanguage::$lang_path |
Definition at line 47 of file class.ilSetupLanguage.php.
Referenced by checkLanguage(), and insertLanguage().
| string ilSetupLanguage::$separator = "#:#" |
Definition at line 49 of file class.ilSetupLanguage.php.
| array ilSetupLanguage::$text |
Definition at line 45 of file class.ilSetupLanguage.php.