TYPO3  7.6
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
LanguageService Class Reference

Public Member Functions

 getParserFactory ()
 
 addModuleLabels ($arr, $prefix)
 
 makeEntities ($str)
 
 debugLL ($value)
 
 getLL ($index, $hsc=false)
 
 getLLL ($index, $localLanguage, $hsc=false)
 
 sL ($input, $hsc=false)
 
 loadSingleTableDescription ($table)
 
 includeLLFile ($fileRef, $setGlobal=true, $mergeLocalOntoDefault=false)
 
 overrideLL ($index, $value, $overrideDefault=true)
 
 getLabelsWithPrefix ($prefix, $strip= '')
 

Public Attributes

 $lang = 'default'
 
 $charSet = 'utf-8'
 
 $charSetArray = array()
 
 $typo3_help_url = 'http://typo3.org/documentation/document-library/'
 
 $debugKey = false
 
 $moduleLabels = array()
 
 $LL_files_cache = array()
 
 $LL_labels_cache = array()
 
 $csConvObj
 
 $parserFactory
 

Protected Member Functions

 localizedFileRef ($fileRef)
 

Protected Attributes

 $languageDependencies = array()
 

Detailed Description

Contains the TYPO3 Backend Language class For detailed information about how localization is handled, please refer to the 'Inside TYPO3' document which describes this. This class is normally instantiated as the global variable $GLOBALS['LANG'] It's only available in the backend and under certain circumstances in the frontend

See Also

Definition at line 29 of file LanguageService.php.

Member Function Documentation

addModuleLabels (   $arr,
  $prefix 
)

Adds labels and image references from the backend modules to the internal moduleLabels array

Parameters
array$arrArray with references to module labels, keys: ['labels']['table'],
string$prefixModule name prefix
Returns
void
See Also

Definition at line 164 of file LanguageService.php.

debugLL (   $value)

Debugs localization key.

Parameters
string$valuevalue to debug
Returns
string

Definition at line 204 of file LanguageService.php.

Referenced by LanguageService\getLLL(), and LanguageService\sL().

getLabelsWithPrefix (   $prefix,
  $strip = '' 
)

Gets labels with a specific fetched from the current locallang file. This is useful for e.g gathering javascript labels.

Parameters
string$prefixPrefix to select the correct labels
string$stripSub-prefix to be removed from label names in the result
Returns
array Processed labels

Definition at line 491 of file LanguageService.php.

References $GLOBALS.

getLL (   $index,
  $hsc = false 
)

Returns the label with key $index from the globally loaded $LOCAL_LANG array. Mostly used from modules with only one LOCAL_LANG file loaded into the global space.

Parameters
string$indexLabel key
bool$hscIf set, the return value is htmlspecialchar'ed
Returns
string

Definition at line 217 of file LanguageService.php.

References $GLOBALS, and LanguageService\getLLL().

getLLL (   $index,
  $localLanguage,
  $hsc = false 
)

Returns the label with key $index from the $LOCAL_LANG array used as the second argument

Parameters
string$indexLabel key
array$localLanguage$LOCAL_LANG array to get label key from
bool$hscIf set, the return value is htmlspecialchar'ed
Returns
string

Definition at line 230 of file LanguageService.php.

References LanguageService\$lang, LanguageService\debugLL(), and elseif.

Referenced by LanguageService\getLL(), and LanguageService\sL().

getParserFactory ( )

Gets the parser factory.

Returns
LocalizationFactory

Definition at line 151 of file LanguageService.php.

References LanguageService\$parserFactory.

includeLLFile (   $fileRef,
  $setGlobal = true,
  $mergeLocalOntoDefault = false 
)

Includes locallang file (and possibly additional localized version if configured for) Read language labels will be merged with $LOCAL_LANG (if $setGlobal = TRUE).

Parameters
string$fileRef$fileRef is a file-reference
bool$setGlobalSetting in global variable $LOCAL_LANG (or returning the variable)
bool$mergeLocalOntoDefault
Returns
mixed if $setGlobal===TRUE, LL-files set $LOCAL_LANG in global scope, or array is returned from function

Definition at line 375 of file LanguageService.php.

References $GLOBALS, LanguageService\localizedFileRef(), and ArrayUtility\mergeRecursiveWithOverrule().

Referenced by LanguageService\loadSingleTableDescription().

loadSingleTableDescription (   $table)

Loading $TCA_DESCR[$table]['columns'] with content from locallang files as defined in $TCA_DESCR[$table]['refs'] $TCA_DESCR is a global var

Parameters
string$tableTable name found as key in global array $TCA_DESCR
Returns
void

Definition at line 309 of file LanguageService.php.

References $GLOBALS, and LanguageService\includeLLFile().

localizedFileRef (   $fileRef)
protected

Returns localized fileRef (.[langkey].php)

Parameters
string$fileRefFilename/path of a 'locallang.php' file
Returns
string Input filename with a '.[lang-key].php' ending added if $this->lang is not 'default'
Deprecated:
since TYPO3 CMS 7, this method will be removed in CMS 8. Please use XLF files for translation handling.

Definition at line 454 of file LanguageService.php.

References GeneralUtility\logDeprecatedFunction().

Referenced by LanguageService\includeLLFile(), and LanguageService\sL().

makeEntities (   $str)

Will convert the input strings special chars (all above 127) to entities. The string is expected to be encoded in UTF-8 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

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.
Parameters
string$strInput string
Returns
string Output string

Definition at line 192 of file LanguageService.php.

overrideLL (   $index,
  $value,
  $overrideDefault = true 
)

Overrides a label.

Parameters
string$index
string$value
bool$overrideDefaultOverrides default language
Returns
void

Definition at line 472 of file LanguageService.php.

References $GLOBALS, and LanguageService\$lang.

sL (   $input,
  $hsc = false 
)

splitLabel function

All translations are based on $LOCAL_LANG variables. 'language-splitted' labels can therefore refer to a local-lang file + index. Refer to 'Inside TYPO3' for more details

Parameters
string$inputLabel key/reference
bool$hscIf set, the return value is htmlspecialchar'ed
Returns
string

Definition at line 262 of file LanguageService.php.

References LanguageService\$debugKey, LanguageService\$lang, LanguageService\debugLL(), LanguageService\getLLL(), and LanguageService\localizedFileRef().

Member Data Documentation

$charSet = 'utf-8'

Definition at line 43 of file LanguageService.php.

$charSetArray = array()

Definition at line 51 of file LanguageService.php.

$csConvObj

Definition at line 94 of file LanguageService.php.

$debugKey = false

Definition at line 65 of file LanguageService.php.

Referenced by LanguageService\sL().

$lang = 'default'
$languageDependencies = array()
protected

Definition at line 109 of file LanguageService.php.

$LL_files_cache = array()

Definition at line 80 of file LanguageService.php.

$LL_labels_cache = array()

Definition at line 87 of file LanguageService.php.

$moduleLabels = array()

Definition at line 73 of file LanguageService.php.

$parserFactory

Definition at line 101 of file LanguageService.php.

Referenced by LanguageService\getParserFactory().

$typo3_help_url = 'http://typo3.org/documentation/document-library/'

Definition at line 58 of file LanguageService.php.