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

Public Member Functions

 __construct (LanguageStore $languageStore, CacheManager $cacheManager)
 
array< string, getParsedData( $fileReference, $languageKey, $_=null, $__=null, $isLocalizationOverride=false) { $hash=md5( $fileReference . $languageKey);if(! $this->store->hasData( $fileReference, 'default') &&$languageKey !=='default') { $this-> getParsedData ($fileReference, 'default')
 

Public Attributes

TYPO3 CMS Core Localization LanguageStore $store
 
if($this->store->hasData($fileReference, $languageKey)) $data = $this->cacheInstance->get($hash)
 
if($data !==false) try
 
 $parser = $this->store->getParserInstance($fileReference)
 
if(is_callable([$parser, 'parseExtensionResource']) &&PathUtility::isExtensionPath($fileReference)) else
 

Protected Member Functions

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

Protected Attributes

FrontendInterface $cacheInstance
 

Detailed Description

Provides a language parser factory.

Definition at line 30 of file LocalizationFactory.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Localization\LocalizationFactory::__construct ( LanguageStore  $languageStore,
CacheManager  $cacheManager 
)

Member Function Documentation

◆ getParsedData()

array<string, getParsedData($fileReference, $languageKey, $_ = null, $__ = null, $isLocalizationOverride = false) { $hash = md5($fileReference . $languageKey); if (!$this->store->hasData($fileReference, 'default') && $languageKey !== 'default') { $this-> TYPO3\CMS\Core\Localization\LocalizationFactory::getParsedData (   $fileReference,
'default'   
)

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
null$_‪unused
null$__‪unused
bool$isLocalizationOverride‪TRUE if $fileReference is a localization override
Returns
‪array<string, array<string, array<int, array<string, string>>>>

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

◆ 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 115 of file LocalizationFactory.php.

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

Member Data Documentation

◆ $cacheInstance

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

Definition at line 34 of file LocalizationFactory.php.

◆ $data

if ( $this->store->hasData( $fileReference, $languageKey)) TYPO3\CMS\Core\Localization\LocalizationFactory::$data = $this->cacheInstance->get($hash)

Definition at line 71 of file LocalizationFactory.php.

◆ $parser

TYPO3\CMS\Core\Localization\LocalizationFactory::$parser = $this->store->getParserInstance($fileReference)

Definition at line 79 of file LocalizationFactory.php.

◆ $store

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

Definition at line 38 of file LocalizationFactory.php.

◆ else

if (is_callable([ $parser, 'parseExtensionResource']) &&PathUtility::isExtensionPath( $fileReference)) TYPO3\CMS\Core\Localization\LocalizationFactory::else
Initial value:
{
$LOCAL_LANG = ‪$parser->getParsedData($this->store->getAbsoluteFileReference($fileReference), $languageKey)

Definition at line 82 of file LocalizationFactory.php.

◆ try

if ( $data !==false) TYPO3\CMS\Core\Localization\LocalizationFactory::try
Initial value:
{
$this->store->setConfiguration($fileReference, $languageKey)

Definition at line 77 of file LocalizationFactory.php.

‪TYPO3\CMS\Core\Localization\LocalizationFactory\$parser
‪$parser
Definition: LocalizationFactory.php:79