|
ILIAS
trunk Revision v13.0_alpha-62-g3b72d83f2e5
|
Class ilLanguageFile. More...
Collaboration diagram for ilLanguageFile:Public Member Functions | |
| __construct (string $a_file, string $a_key="", string $a_scope="global") | |
| Constructor $a_file language file path and name $a_key (optional) language key $a_scope (optional) scope ('global', 'local' or 'unchanged') More... | |
| read () | |
| Read a language file Return true, if reading successful. More... | |
| keepOriginalLines (array $keys) | |
| build()/write() emit the lines of $keys as read(), without whitespace normalisation, e.g. More... | |
| write (string $a_header="") | |
| Write a language file. More... | |
| build (string $a_header='') | |
| Build and get the file content. More... | |
| getErrorMessage () | |
| Get the error message of the last read/write operation. More... | |
| getHeader () | |
| Get the header of the original file. More... | |
| getAllParams () | |
| Get array of all parameters Return array [name => value]. More... | |
| getAllValues () | |
| Get array of all values Return array [module.separator.identifier => value]. More... | |
| getAllComments () | |
| Get array of all comments Return array [module.separator.identifier => comment]. More... | |
| getParam (string $a_name) | |
| Get a single parameter $a_name parameter name. More... | |
| getValue (string $a_module, string $a_identifier) | |
| Get a single value $a_module module name $a_identifier indentifier. More... | |
| getComment (string $a_module, string $a_identifier) | |
| Get a single comment $a_module module name $a_identifier indentifier. More... | |
| setParam (string $a_name, string $a_value) | |
| Set a parameter $a_name parameter name $a_value parameter value. More... | |
| setValue (string $a_module, string $a_identifier, string $a_value) | |
| Set a single value $a_module module name $a_identifier indentifier $a_value value. More... | |
| setAllValues (array $a_values) | |
| Set all values $a_values [module.separator.identifier => value]. More... | |
| setAllComments (array $a_comments) | |
| Set all comments $a_comments [module.separator.identifier => comment]. More... | |
| setComment (string $a_module, string $a_identifier, string $a_comment) | |
| Set a single comment $a_module module name $a_identifier indentifier $a_comment comment. More... | |
Static Public Member Functions | |
| static | _getGlobalLanguageFile (string $a_lang_key) |
| Read and get a global language file as a singleton object $a_lang_key language key. More... | |
Private Member Functions | |
| buildLine (string $key, string $value, ?string $comment) | |
Private Attributes | |
| string | $lang_file |
| string | $lang_key |
| string | $scope |
| string | $header |
| string | $file_start = "<!-- language file start -->" |
| string | $separator |
| string | $comment_separator |
| array | $params |
| array | $values |
| array | $comments |
| string | $error_message = "" |
| array | $read_lines = [] |
| array | $read_values = [] |
| array | $read_comments = [] |
| array | $kept_keys = [] |
Static Private Attributes | |
| static array | $global_file_objects |
Class ilLanguageFile.
Provides methods for working with language files: read, check and write content, comments and parameters
Definition at line 32 of file class.ilLanguageFile.php.
| ilLanguageFile::__construct | ( | string | $a_file, |
| string | $a_key = "", |
||
| string | $a_scope = "global" |
||
| ) |
Constructor $a_file language file path and name $a_key (optional) language key $a_scope (optional) scope ('global', 'local' or 'unchanged')
Definition at line 61 of file class.ilLanguageFile.php.
References $DIC, $file_start, $lng, ILIAS\UI\examples\Symbol\Glyph\Header\header(), and ILIAS_VERSION.
Here is the call graph for this function:
|
static |
Read and get a global language file as a singleton object $a_lang_key language key.
Lines of modules maintained in PO files are not that module's source, see ilObjLanguageExt::getShippedValues().
Definition at line 428 of file class.ilLanguageFile.php.
Referenced by ilObjLanguageExt\findInvalidMarkupOfChangedValues(), ilObjLanguageExt\getGlobalLanguageFile(), and ShippedValuesOfMigratedModulesTest\testWithoutDirectoryManagerTheShippedValuesAreThePlainGlobalLanguageFile().
Here is the caller graph for this function:| ilLanguageFile::build | ( | string | $a_header = '' | ) |
Build and get the file content.
$a_header (optional) fixed header for the new file
Definition at line 225 of file class.ilLanguageFile.php.
References $DIC, $lng, ILIAS\News\Common\Table\$tpl, buildLine(), ILIAS\UICore\GlobalTemplate\get(), getAllParams(), ILIAS\UICore\GlobalTemplate\parseCurrentBlock(), ILIAS\UICore\GlobalTemplate\setCurrentBlock(), ILIAS\UICore\GlobalTemplate\setVariable(), and ILIAS\Scripts\PHPStan\str_repeat.
Referenced by ilLanguageFileTest\builtLines(), and write().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 291 of file class.ilLanguageFile.php.
References $comment.
Referenced by build().
Here is the caller graph for this function:| ilLanguageFile::getAllComments | ( | ) |
Get array of all comments Return array [module.separator.identifier => comment].
Definition at line 337 of file class.ilLanguageFile.php.
References $comments.
Referenced by ilObjLanguageExt\shippedValuesAndComments().
Here is the caller graph for this function:| ilLanguageFile::getAllParams | ( | ) |
Get array of all parameters Return array [name => value].
Definition at line 319 of file class.ilLanguageFile.php.
References $params.
Referenced by build().
Here is the caller graph for this function:| ilLanguageFile::getAllValues | ( | ) |
Get array of all values Return array [module.separator.identifier => value].
Definition at line 328 of file class.ilLanguageFile.php.
References $values.
Referenced by ilObjLanguageExt\getShippedChangesSinceBackup(), and ilObjLanguageExt\shippedValuesAndComments().
Here is the caller graph for this function:| ilLanguageFile::getComment | ( | string | $a_module, |
| string | $a_identifier | ||
| ) |
Get a single comment $a_module module name $a_identifier indentifier.
Definition at line 366 of file class.ilLanguageFile.php.
| ilLanguageFile::getErrorMessage | ( | ) |
Get the error message of the last read/write operation.
Definition at line 300 of file class.ilLanguageFile.php.
References $error_message.
| ilLanguageFile::getHeader | ( | ) |
Get the header of the original file.
Definition at line 309 of file class.ilLanguageFile.php.
References $header.
| ilLanguageFile::getParam | ( | string | $a_name | ) |
Get a single parameter $a_name parameter name.
Definition at line 346 of file class.ilLanguageFile.php.
| ilLanguageFile::getValue | ( | string | $a_module, |
| string | $a_identifier | ||
| ) |
Get a single value $a_module module name $a_identifier indentifier.
Definition at line 356 of file class.ilLanguageFile.php.
| ilLanguageFile::keepOriginalLines | ( | array | $keys | ) |
build()/write() emit the lines of $keys as read(), without whitespace normalisation, e.g.
to leave the lines of modules maintained in PO files untouched. Keys not read from the file are ignored.
| list<string> | $keys module.separator.identifier |
Definition at line 199 of file class.ilLanguageFile.php.
| ilLanguageFile::read | ( | ) |
Read a language file Return true, if reading successful.
Otherwise return false
Definition at line 99 of file class.ilLanguageFile.php.
References $comments, $DIC, $lng, $param, $values, and ILIAS\UI\examples\Symbol\Glyph\Header\header().
Here is the call graph for this function:| ilLanguageFile::setAllComments | ( | array | $a_comments | ) |
Set all comments $a_comments [module.separator.identifier => comment].
Definition at line 405 of file class.ilLanguageFile.php.
| ilLanguageFile::setAllValues | ( | array | $a_values | ) |
Set all values $a_values [module.separator.identifier => value].
Definition at line 396 of file class.ilLanguageFile.php.
| ilLanguageFile::setComment | ( | string | $a_module, |
| string | $a_identifier, | ||
| string | $a_comment | ||
| ) |
Set a single comment $a_module module name $a_identifier indentifier $a_comment comment.
Definition at line 417 of file class.ilLanguageFile.php.
| ilLanguageFile::setParam | ( | string | $a_name, |
| string | $a_value | ||
| ) |
Set a parameter $a_name parameter name $a_value parameter value.
Definition at line 376 of file class.ilLanguageFile.php.
| ilLanguageFile::setValue | ( | string | $a_module, |
| string | $a_identifier, | ||
| string | $a_value | ||
| ) |
Set a single value $a_module module name $a_identifier indentifier $a_value value.
Definition at line 387 of file class.ilLanguageFile.php.
| ilLanguageFile::write | ( | string | $a_header = "" | ) |
Write a language file.
$a_header (optional) fixed header for the new file
Definition at line 213 of file class.ilLanguageFile.php.
References build().
Here is the call graph for this function:
|
private |
Definition at line 41 of file class.ilLanguageFile.php.
|
private |
Definition at line 44 of file class.ilLanguageFile.php.
Referenced by getAllComments(), and read().
|
private |
Definition at line 45 of file class.ilLanguageFile.php.
Referenced by getErrorMessage().
|
private |
Definition at line 39 of file class.ilLanguageFile.php.
Referenced by __construct().
|
staticprivate |
Definition at line 34 of file class.ilLanguageFile.php.
|
private |
Definition at line 38 of file class.ilLanguageFile.php.
Referenced by getHeader().
|
private |
Definition at line 53 of file class.ilLanguageFile.php.
|
private |
Definition at line 35 of file class.ilLanguageFile.php.
|
private |
Definition at line 36 of file class.ilLanguageFile.php.
|
private |
Definition at line 42 of file class.ilLanguageFile.php.
Referenced by getAllParams().
|
private |
Definition at line 51 of file class.ilLanguageFile.php.
|
private |
Definition at line 47 of file class.ilLanguageFile.php.
|
private |
Definition at line 49 of file class.ilLanguageFile.php.
|
private |
Definition at line 37 of file class.ilLanguageFile.php.
|
private |
Definition at line 40 of file class.ilLanguageFile.php.
|
private |
Definition at line 43 of file class.ilLanguageFile.php.
Referenced by getAllValues(), and read().