‪TYPO3CMS  11.5
TYPO3\CMS\Core\Localization\LanguageStore Class Reference
Inheritance diagram for TYPO3\CMS\Core\Localization\LanguageStore:
TYPO3\CMS\Core\SingletonInterface

Public Member Functions

 initialize ()
 
bool hasData ($fileReference, $languageKey)
 
TYPO3 CMS Core Localization LanguageStore setData ($fileReference, $languageKey, $data)
 
TYPO3 CMS Core Localization LanguageStore flushData ($fileReference)
 
TYPO3 CMS Core Localization LanguageStore setConfiguration ($fileReference, $languageKey)
 
string getFileReferenceWithoutExtension ($fileReference)
 
TYPO3 CMS Core Localization Parser LocalizationParserInterface getParserInstance ($fileReference)
 
string getAbsoluteFileReference ($fileReference)
 
string getLocalizedLabelsPathPattern (string $fileReference)
 
array getSupportedExtensions ()
 

Public Attributes

array< string, function getData( $fileReference) { return $this-> data [$fileReference]
 
array< string, function getDataByLanguage( $fileReference, $languageKey) { return $this-> data [$fileReference][$languageKey][]
 

Protected Attributes

array $supportedExtensions
 
array $configuration
 
array< string, $data;private PackageManager $packageManager;public function __construct(PackageManager $packageManager) { $this-> packageManager = $packageManager
 

Detailed Description

This class is not part of the TYPO3 Core API.

Definition at line 28 of file LanguageStore.php.

Member Function Documentation

◆ flushData()

TYPO3 CMS Core Localization LanguageStore TYPO3\CMS\Core\Localization\LanguageStore::flushData (   $fileReference)

Flushes data.

Parameters
string$fileReference
Returns
‪\TYPO3\CMS\Core\Localization\LanguageStore This instance to allow method chaining

Definition at line 138 of file LanguageStore.php.

References TYPO3\CMS\Core\Localization\LanguageStore\data.

◆ getAbsoluteFileReference()

string TYPO3\CMS\Core\Localization\LanguageStore::getAbsoluteFileReference (   $fileReference)

Gets the absolute file path.

Parameters
string$fileReference
Returns
‪string
Exceptions

Definition at line 232 of file LanguageStore.php.

◆ getFileReferenceWithoutExtension()

string TYPO3\CMS\Core\Localization\LanguageStore::getFileReferenceWithoutExtension (   $fileReference)

Get the fileReference without the extension

Parameters
string$fileReference‪File reference
Returns
‪string

Definition at line 202 of file LanguageStore.php.

Referenced by TYPO3\CMS\Core\Localization\LanguageStore\setConfiguration().

◆ getLocalizedLabelsPathPattern()

string TYPO3\CMS\Core\Localization\LanguageStore::getLocalizedLabelsPathPattern ( string  $fileReference)

Gets the relative labels file pattern.

Parameters
string$fileReference
Returns
‪string
Exceptions

Definition at line 247 of file LanguageStore.php.

◆ getParserInstance()

TYPO3 CMS Core Localization Parser LocalizationParserInterface TYPO3\CMS\Core\Localization\LanguageStore::getParserInstance (   $fileReference)

Returns the correct parser for a specific file reference.

Parameters
string$fileReference‪File reference
Returns
‪\TYPO3\CMS\Core\Localization\Parser\LocalizationParserInterface
Exceptions

Definition at line 217 of file LanguageStore.php.

◆ getSupportedExtensions()

array TYPO3\CMS\Core\Localization\LanguageStore::getSupportedExtensions ( )

Get supported extensions

Returns
‪array

Definition at line 261 of file LanguageStore.php.

References TYPO3\CMS\Core\Localization\LanguageStore\$supportedExtensions.

◆ hasData()

bool TYPO3\CMS\Core\Localization\LanguageStore::hasData (   $fileReference,
  $languageKey 
)

Checks if the store contains parsed data.

Parameters
string$fileReference‪File reference
string$languageKey‪Valid language key
Returns
‪bool

Definition at line 81 of file LanguageStore.php.

References TYPO3\CMS\Core\Localization\LanguageStore\data.

◆ initialize()

TYPO3\CMS\Core\Localization\LanguageStore::initialize ( )

Initializes the current class.

Definition at line 65 of file LanguageStore.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

◆ setConfiguration()

TYPO3 CMS Core Localization LanguageStore TYPO3\CMS\Core\Localization\LanguageStore::setConfiguration (   $fileReference,
  $languageKey 
)

Checks file reference configuration (charset, extension, ...).

Parameters
string$fileReference‪File reference
string$languageKey‪Valid language key
Returns
‪\TYPO3\CMS\Core\Localization\LanguageStore This instance to allow method chaining
Exceptions

Definition at line 153 of file LanguageStore.php.

References $GLOBALS, TYPO3\CMS\Core\Localization\LanguageStore\getFileReferenceWithoutExtension(), TYPO3\CMS\Core\Utility\PathUtility\isExtensionPath(), and TYPO3\CMS\Core\Localization\LanguageStore\packageManager.

◆ setData()

TYPO3 CMS Core Localization LanguageStore TYPO3\CMS\Core\Localization\LanguageStore::setData (   $fileReference,
  $languageKey,
  $data 
)

Sets data for a specific file reference and a language.

Parameters
string$fileReference‪File reference
string$languageKey‪Valid language key
array$data
Returns
‪\TYPO3\CMS\Core\Localization\LanguageStore This instance to allow method chaining

Definition at line 126 of file LanguageStore.php.

References TYPO3\CMS\Core\Localization\LanguageStore\data.

Member Data Documentation

◆ $configuration

array TYPO3\CMS\Core\Localization\LanguageStore::$configuration
protected

Information about parsed file

If data come from the cache, this array does not contain any information about this file

Definition at line 43 of file LanguageStore.php.

◆ $supportedExtensions

array TYPO3\CMS\Core\Localization\LanguageStore::$supportedExtensions
protected

File extension supported by the localization parser

Definition at line 34 of file LanguageStore.php.

Referenced by TYPO3\CMS\Core\Localization\LanguageStore\getSupportedExtensions().

◆ data [1/2]

array<string, function getData($fileReference) { return $this-> TYPO3\CMS\Core\Localization\LanguageStore::data[ $fileReference]

Retrieves data from the store.

This method returns all parsed languages for the current file reference.

Parameters
string$fileReference‪File reference
Returns
‪array<string, array<string, array<int, array<string, string>>>>

Definition at line 100 of file LanguageStore.php.

Referenced by TYPO3\CMS\Core\Localization\LanguageStore\flushData(), TYPO3\CMS\Core\Localization\LanguageStore\hasData(), and TYPO3\CMS\Core\Localization\LanguageStore\setData().

◆ data [2/2]

array<string, function getDataByLanguage($fileReference, $languageKey) { return $this-> TYPO3\CMS\Core\Localization\LanguageStore::data[ $fileReference][ $languageKey][]

Retrieves data from the store for a language.

Parameters
string$fileReference‪File reference
string$languageKey‪Valid language key
Returns
‪array<string, array<int, array<string, string>>>
See also
‪self::getData()

Definition at line 115 of file LanguageStore.php.

◆ packageManager

array<string, $data; private PackageManager $packageManager; public function __construct(PackageManager $packageManager) { $this-> TYPO3\CMS\Core\Localization\LanguageStore::packageManager = $packageManager
protected

Parsed localization file

array<string, array<string, array<int, array<string, string>>>>>

Definition at line 58 of file LanguageStore.php.

Referenced by TYPO3\CMS\Core\Localization\LanguageStore\setConfiguration().