‪TYPO3CMS  9.5
TYPO3\CMS\Core\Localization\LocalizationFactory Class Reference
Inheritance diagram for TYPO3\CMS\Core\Localization\LocalizationFactory:
TYPO3\CMS\Core\SingletonInterface

Public Member Functions

 __construct ()
 
array bool getParsedData ($fileReference, $languageKey, $charset='', $errorMode=null, $isLocalizationOverride=false)
 

Public Attributes

TYPO3 CMS Core Localization LanguageStore $store
 

Protected Member Functions

 initializeCache ()
 
 localizationOverride ($fileReference, $languageKey, array &$LOCAL_LANG)
 

Protected Attributes

TYPO3 CMS Core Cache Frontend FrontendInterface $cacheInstance
 

Detailed Description

Provides a language parser factory.

Definition at line 24 of file LocalizationFactory.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Localization\LocalizationFactory::__construct ( )

Class constructor

Definition at line 37 of file LocalizationFactory.php.

References TYPO3\CMS\Core\Localization\LocalizationFactory\initializeCache().

Member Function Documentation

◆ getParsedData()

array bool TYPO3\CMS\Core\Localization\LocalizationFactory::getParsedData (   $fileReference,
  $languageKey,
  $charset = '',
  $errorMode = null,
  $isLocalizationOverride = false 
)

Returns parsed data from a given file and language key.

Parameters
string$fileReference‪Input is a file-reference (see \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName). That file is expected to be a supported locallang file format
string$languageKey‪Language key
string$charset‪Character set (option); not in use anymore
int$errorModeError mode (when file could not be found): not in use anymore
bool$isLocalizationOverride‪TRUE if $fileReference is a localization override
Returns
‪array|bool

Definition at line 61 of file LocalizationFactory.php.

References $GLOBALS, $parser, and TYPO3\CMS\Core\Localization\LocalizationFactory\localizationOverride().

Referenced by TYPO3\CMS\Core\Tests\Unit\Localization\Parser\LocallangXmlParserTest\canTranslateNumericKeys(), and TYPO3\CMS\Core\Localization\LocalizationFactory\localizationOverride().

◆ initializeCache()

TYPO3\CMS\Core\Localization\LocalizationFactory::initializeCache ( )
protected

Initialize cache instance to be ready to use

Definition at line 46 of file LocalizationFactory.php.

Referenced by TYPO3\CMS\Core\Localization\LocalizationFactory\__construct().

◆ localizationOverride()

TYPO3\CMS\Core\Localization\LocalizationFactory::localizationOverride (   $fileReference,
  $languageKey,
array &  $LOCAL_LANG 
)
protected

Override localization file

This method merges the content of the override file with the default file

Parameters
string$fileReference
string$languageKey
array$LOCAL_LANG

Definition at line 150 of file LocalizationFactory.php.

References $GLOBALS, TYPO3\CMS\Core\Localization\LocalizationFactory\getParsedData(), and TYPO3\CMS\Core\Utility\ArrayUtility\mergeRecursiveWithOverrule().

Referenced by TYPO3\CMS\Core\Localization\LocalizationFactory\getParsedData().

Member Data Documentation

◆ $cacheInstance

TYPO3 CMS Core Cache Frontend FrontendInterface TYPO3\CMS\Core\Localization\LocalizationFactory::$cacheInstance
protected

Definition at line 28 of file LocalizationFactory.php.

◆ $store

TYPO3 CMS Core Localization LanguageStore TYPO3\CMS\Core\Localization\LocalizationFactory::$store

Definition at line 32 of file LocalizationFactory.php.