Contains the TYPO3 Backend Language class
For detailed information about how localization is handled,
please refer to the 'Inside TYPO3' document which descibes this.
This class is normally instantiated as the global variable $LANG in typo3/template.php
It's only available in the backend and under certain circumstances in the frontend
Files: 1
Total filesizes: 18.4 Kbytes
Functions and classes: 13
Contains the TYPO3 Backend Language class
For detailed information about how localization is handled,
please refer to the 'Inside TYPO3' document which descibes this.
This class is normally instantiated as the global variable $LANG in typo3/template.php
It's only available in the backend and under certain circumstances in the frontend
@package: TYPO3
@subpackage: core
Contains the TYPO3 Backend Language class
For detailed information about how localization is handled,
please refer to the 'Inside TYPO3' document which descibes this.
This class is normally instantiated as the global variable $LANG in typo3/template.php
It's only available in the backend and under certain circumstances in the frontend
Filesize: | 18.4 K |
Func/Classes: | 13 |
Tags: | @author Kasper Skaarhoj <kasperYYYY@typo3.com> @package TYPO3 @subpackage core @see typo3/template.php, template |
Contains the TYPO3 Backend Language class
For detailed information about how localization is handled,
please refer to the 'Inside TYPO3' document which descibes this.
This class is normally instantiated as the global variable $LANG in typo3/template.php
It's only available in the backend and under certain circumstances in the frontend
Returns: | [type] | ... |
@author Kasper Skaarhoj <kasperYYYY@typo3.com> | ||
@package TYPO3 | ||
@subpackage core | ||
@see typo3/template.php, template |
Initializes the backend language.
This is for example done in typo3/template.php with lines like these:
require (PATH_typo3.'sysext/lang/lang.php');
$LANG = t3lib_div::makeInstance('language');
$LANG->init($BE_USER->uc['lang']);
$lang | string | The language key (two character string from backend users profile) |
$altPath='' | string | IGNORE. Not used. |
Returns: | void |
Adds labels and image references from the backend modules to the internal moduleLabels array
$arr | array | Array with references to module labels, keys: ['labels']['tablabel'], ['labels']['tabdescr'], ['tabs']['tab'] |
$prefix | string | Module name prefix |
Returns: | void | |
@see t3lib_loadModules |
Will htmlspecialchar() the input string and before that any charset conversion will also have taken place if needed (see init())
Used to pipe language labels through just before they are returned.
$lStr | string | The string to process |
$hsc | boolean | If set, then the string is htmlspecialchars()'ed |
Returns: | string | The processed string |
@see init() |
Will convert the input strings special chars (all above 127) to entities. The string is expected to be encoded in the charset, $this->charSet
This function is used to create strings that can be used in the Click Menu (Context Sensitive Menus). The reason is that the values that are dynamically written into the <div> layer is decoded as iso-8859-1 no matter what charset is used in the document otherwise (only MSIE, Mozilla is OK). So by converting we by-pass this problem.
$str | string | Input string |
Returns: | string | Output string |
Converts the input string to a JavaScript function returning the same string, but charset-safe.
Used for confirm and alert boxes where we must make sure that any string content does not break the script AND want to make sure the charset is preserved.
Originally I used the JS function unescape() in combination with PHP function rawurlencode() in order to pass strings in a safe way. This could still be done for iso-8859-1 charsets but now I have applied the same method here for all charsets.
$str | string | Input string, encoded with $this->charSet |
Returns: | string | Output string, a JavaScript function: "String.fromCharCode(......)" |
Returns the label with key $index form the globally loaded $LOCAL_LANG array.
Mostly used from modules with only one LOCAL_LANG file loaded into the global space.
$index | string | Label key |
$hsc=0 | boolean | If set, the return value is htmlspecialchar'ed |
Returns: | string |
Works like ->getLL() but takes the $LOCAL_LANG array used as the second argument instead of using the global array.
$index | string | Label key |
$LOCAL_LANG | array | $LOCAL_LANG array to get label key from |
$hsc=0 | boolean | If set, the return value is htmlspecialchar'ed |
Returns: | string |
splitLabel function
Historically labels were exploded by '|' and each part would correspond to the translation of the language found at the same 'index' in the TYPO3_languages constant.
Today all translations are based on $LOCAL_LANG variables. 'language-splitted' labels can therefore refer to a local-lang file + index instead!
It's highly recommended to use the 'local_lang' method (and thereby it's highly deprecated to use 'language-splitted' label strings)
Refer to 'Inside TYPO3' for more details
$input | string | Label key/reference |
$hsc=0 | boolean | If set, the return value is htmlspecialchar'ed |
Returns: | string |
Loading $TCA_DESCR[$table]['columns'] with content from locallang files as defined in $TCA_DESCR[$table]['refs']
$TCA_DESCR is a global var
$table | string | Table name found as key in global array $TCA_DESCR |
Returns: | void |
Includes locallang file (and possibly additional localized version if configured for)
Read language labels will be merged with $LOCAL_LANG (if $setGlobal=1).
$fileRef | string | $fileRef is a file-reference (see t3lib_div::getFileAbsFileName) |
$setGlobal=1 | boolean | Setting in global variable $LOCAL_LANG (or returning the variable) |
$mergeLocalOntoDefault=0 | boolean | If $mergeLocalOntoDefault is set the local part of the $LOCAL_LANG array is merged onto the default part (if the local part exists) and the local part is unset. |
Returns: | mixed | If $setGlobal is true the LL-files will set the $LOCAL_LANG in the global scope. Otherwise the $LOCAL_LANG array is returned from function |
Includes a locallang file and returns the $LOCAL_LANG array found inside.
$fileRef | string | Input is a file-reference (see t3lib_div::getFileAbsFileName) which, if exists, is included. That file is expected to be a 'local_lang' file containing a $LOCAL_LANG array. |
Returns: | array | Value of $LOCAL_LANG found in the included file. If that array is found it's returned. Otherwise an empty array |
Returns localized fileRef (.[langkey].php)
$fileRef | string | Filename/path of a 'locallang.php' file |
Returns: | string | Input filename with a '.[lang-key].php' ending added if $this->lang is not 'default' |