ILIAS
Release_4_4_x_branch Revision 61816
|
language handling More...
Public Member Functions | |
ilLanguage ($a_lang_key) | |
Constructor read the single-language file and put this in an array text. | |
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 | |
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 | |
exists ($a_topic) | |
Check if language entry exists. | |
loadLanguageModule ($a_module) | |
getInstalledLanguages () | |
_lookupEntry ($a_lang_key, $a_mod, $a_id) | |
getUsedTopics () | |
getUsedModules () | |
getUserLanguage () | |
ilLanguage ($a_lang_key) | |
Constructor read the single-language file and put this in an array text. | |
txt ($a_topic) | |
gets the text for a given topic | |
getLanguages () | |
get all setup languages in the system | |
installLanguages ($a_lang_keys, $a_local_keys) | |
install languages | |
getInstalledLanguages () | |
get already installed languages (in db) | |
getInstalledLocalLanguages () | |
get already installed local languages (in db) | |
getAvailableLanguages () | |
get already registered languages (in db) | |
checkLanguage ($a_lang_key, $scope= '') | |
validate the logical structure of a lang-file | |
cut_header ($content) | |
Remove *.lang header information from '$content'. | |
flushLanguage ($a_lang_key, $a_mode= 'all') | |
remove language data from database | |
getLocalChanges ($a_lang_key, $a_min_date="", $a_max_date="") | |
get locally changed language entries | |
insertLanguage ($lang_key, $scope= '') | |
insert language data from file in database | |
getLocalLanguages () | |
Searches for the existence of *.lang.local files. | |
getInstallableLanguages () | |
setDbHandler ($a_db_handler) | |
set db handler object object db handler | |
loadLanguageModule () |
Static Public Member Functions | |
static | lookupId ($a_lang_key) |
Lookup obj_id of language ilDB $ilDB. | |
static | _deleteLangData ($a_lang_key, $a_keep_local_change) |
Delete languge data. | |
static | replaceLangModule ($a_key, $a_module, $a_array) |
Replace language module array. | |
static | replaceLangEntry ($a_module, $a_identifier, $a_lang_key, $a_value, $a_local_change=null) |
Replace lang entry. | |
static | updateLangEntry ($a_module, $a_identifier, $a_lang_key, $a_value, $a_local_change=null) |
Update lang entry. |
Data Fields | |
$ilias | |
$text = array() | |
$lang_default = "en" | |
$lang_user | |
$lang_path | |
$lang_key | |
$lang_name | |
$separator = "#:#" | |
$comment_separator = "###" | |
$loaded_modules |
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.
|
static |
Delete languge data.
string | lang key |
Definition at line 517 of file class.ilLanguage.php.
Referenced by flushLanguage().
ilLanguage::_lookupEntry | ( | $a_lang_key, | |
$a_mod, | |||
$a_id | |||
) |
Definition at line 341 of file class.ilLanguage.php.
Referenced by ilLinkChecker\__txt(), ilPersonalSettingsGUI\initGeneralSettingsForm(), ilAccountMail\replacePlaceholders(), ilStartUpGUI\showLanguageSelection(), ilUserCronCheckAccounts\txt(), txt(), and txtlng().
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 411 of file class.ilLanguage.php.
References $lang_path, $path, and cut_header().
Referenced by installLanguages().
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 480 of file class.ilLanguage.php.
Referenced by checkLanguage(), and insertLanguage().
ilLanguage::exists | ( | $a_topic | ) |
Check if language entry exists.
object | $a_topic |
Definition at line 272 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 499 of file class.ilLanguage.php.
References _deleteLangData().
Referenced by installLanguages().
ilLanguage::getAvailableLanguages | ( | ) |
get already registered languages (in db)
Definition at line 381 of file class.ilLanguage.php.
Referenced by installLanguages().
ilLanguage::getDefaultLanguage | ( | ) |
Definition at line 186 of file class.ilLanguage.php.
ilLanguage::getInstallableLanguages | ( | ) |
Definition at line 789 of file class.ilLanguage.php.
References $d, $lang_key, and getLanguages().
ilLanguage::getInstalledLanguages | ( | ) |
Definition at line 324 of file class.ilLanguage.php.
References $lang, and ilObject\_getObjectsByType().
Referenced by ilLanguage(), and ilInitialisation\initLanguage().
ilLanguage::getInstalledLanguages | ( | ) |
get already installed languages (in db)
Definition at line 334 of file class.ilLanguage.php.
ilLanguage::getInstalledLocalLanguages | ( | ) |
get already installed local languages (in db)
Definition at line 358 of file class.ilLanguage.php.
ilLanguage::getLangKey | ( | ) |
Definition at line 181 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 public
Definition at line 189 of file class.ilLanguage.php.
Referenced by getInstallableLanguages().
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 541 of file class.ilLanguage.php.
References $result, $row, and DB_FETCHMODE_ASSOC.
Referenced by insertLanguage().
ilLanguage::getLocalLanguages | ( | ) |
Searches for the existence of *.lang.local files.
return $local_langs array of language keys
Definition at line 764 of file class.ilLanguage.php.
ilLanguage::getUsedModules | ( | ) |
Definition at line 399 of file class.ilLanguage.php.
ilLanguage::getUsedTopics | ( | ) |
Definition at line 386 of file class.ilLanguage.php.
ilLanguage::getUserLanguage | ( | ) |
Definition at line 412 of file class.ilLanguage.php.
References $lang_user.
ilLanguage::ilLanguage | ( | $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 100 of file class.ilLanguage.php.
References $row, and ILIAS_ABSOLUTE_PATH.
ilLanguage::ilLanguage | ( | $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 123 of file class.ilLanguage.php.
References $ilias, $ilIliasIniFile, $ilSetting, $ilUser, $lang_default, $log, getInstalledLanguages(), ILIAS_ABSOLUTE_PATH, and loadLanguageModule().
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 577 of file class.ilLanguage.php.
References $lang_key, $lang_path, $path, $row, cut_header(), getLocalChanges(), replaceLangEntry(), replaceLangModule(), and updateLangEntry().
Referenced by installLanguages().
ilLanguage::installLanguages | ( | $a_lang_keys, | |
$a_local_keys | |||
) |
install languages
array | array with lang_keys of languages to install |
Definition at line 216 of file class.ilLanguage.php.
References $lang_key, $query, checkLanguage(), flushLanguage(), getAvailableLanguages(), and insertLanguage().
ilLanguage::loadLanguageModule | ( | $a_module | ) |
Definition at line 277 of file class.ilLanguage.php.
References $lang_key, $lang_user, $row, and DB_FETCHMODE_ASSOC.
Referenced by ilObjUserGUI\__sendProfileMail().
ilLanguage::loadLanguageModule | ( | ) |
Definition at line 831 of file class.ilLanguage.php.
Referenced by ilLanguage().
|
static |
Lookup obj_id of language ilDB $ilDB.
string | $a_lang_key |
Definition at line 369 of file class.ilLanguage.php.
References $query, $res, $row, and DB_FETCHMODE_OBJECT.
Referenced by ilStartUpGUI\getLoginPageEditorHTML(), and ilAuthLoginPageEditorTableGUI\parse().
|
staticfinal |
Replace lang entry.
Definition at line 723 of file class.ilLanguage.php.
Referenced by insertLanguage().
|
staticfinal |
Replace language module array.
Definition at line 703 of file class.ilLanguage.php.
Referenced by insertLanguage().
ilLanguage::setDbHandler | ( | $a_db_handler | ) |
set db handler object object db handler
Definition at line 819 of file class.ilLanguage.php.
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 public
string | topic |
Definition at line 151 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
public
string | topic |
Definition at line 220 of file class.ilLanguage.php.
References _lookupEntry().
Referenced by ilObjTestDynamicQuestionSetConfig\getDepenciesBrokenMessage(), ilTestRandomQuestionSetConfig\getDepenciesBrokenMessage(), ilObjTestDynamicQuestionSetConfig\getDepenciesInVulnerableStateMessage(), ilAssQuestionHint\getHintIndexLabel(), ilTestRandomQuestionSetSourcePoolDefinition\getPoolInfoLabel(), ilObjTest\getQuestionSetTypeTranslation(), ilObjTestDynamicQuestionSetConfig\getSourceQuestionPoolSummaryString(), and txtlng().
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
public
string | topic | |
string | $a_language | The language of the output string |
Definition at line 200 of file class.ilLanguage.php.
References _lookupEntry(), and txt().
|
staticfinal |
Update lang entry.
Definition at line 746 of file class.ilLanguage.php.
Referenced by insertLanguage().
ilLanguage::$comment_separator = "###" |
Definition at line 103 of file class.ilLanguage.php.
ilLanguage::$ilias |
Definition at line 34 of file class.ilLanguage.php.
Referenced by ilLanguage().
ilLanguage::$lang_default = "en" |
Definition at line 51 of file class.ilLanguage.php.
Referenced by ilLanguage().
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().
ilLanguage::$loaded_modules |
Definition at line 111 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.