LanguageStore

class \TYPO3\CMS\Core\Localization\LanguageStore

Implements
SingletonInterface

Table of Contents

Interfaces

SingletonInterface
"empty" interface for singletons (marker interface pattern)

Properties

$configuration  : array
Information about parsed file
$data  : array<string, array<string, array<string, array<int, array<string, string>>>>>
Parsed localization file
$supportedExtensions  : array
File extension supported by the localization parser

Methods

__construct()  : mixed
Constructor
flushData()  : LanguageStore
Flushes data.
getAbsoluteFileReference()  : string
Gets the absolute file path.
getData()  : array<string, array<string, array<int, array<string, string>>>>
Retrieves data from the store.
getDataByLanguage()  : array<string, array<int, array<string, string>>>
Retrieves data from the store for a language.
getFileReferenceWithoutExtension()  : string
Get the fileReference without the extension
getLocalizedLabelsPathPattern()  : string
Gets the relative labels file pattern.
getParserInstance()  : LocalizationParserInterface
Returns the correct parser for a specific file reference.
getSupportedExtensions()  : array
Get supported extensions
hasData()  : bool
Checks if the store contains parsed data.
initialize()  : mixed
Initializes the current class.
setConfiguration()  : LanguageStore
Checks file reference configuration (charset, extension, ...).
setData()  : LanguageStore
Sets data for a specific file reference and a language.

Properties

$configuration

Information about parsed file

protected array $configuration

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

$data

Parsed localization file

protected array<string, array<string, array<string, array<int, array<string, string>>>>> $data

$supportedExtensions

File extension supported by the localization parser

protected array $supportedExtensions

Methods

flushData()

Flushes data.

public flushData(string $fileReference) : LanguageStore

Parameters

$fileReference : string

Return values

LanguageStore —

This instance to allow method chaining

getAbsoluteFileReference()

Gets the absolute file path.

public getAbsoluteFileReference(string $fileReference) : string

Parameters

$fileReference : string

Tags

throws
InvalidArgumentException

Return values

string

getData()

Retrieves data from the store.

public getData(string $fileReference) : array<string, array<string, array<int, array<string, string>>>>

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

Parameters

$fileReference : string

File reference

Return values

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

getDataByLanguage()

Retrieves data from the store for a language.

public getDataByLanguage(string $fileReference, string $languageKey) : array<string, array<int, array<string, string>>>

Parameters

$fileReference : string

File reference

$languageKey : string

Valid language key

Tags

see
self::getData()

Return values

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

getFileReferenceWithoutExtension()

Get the fileReference without the extension

public getFileReferenceWithoutExtension(string $fileReference) : string

Parameters

$fileReference : string

File reference

Return values

string

getLocalizedLabelsPathPattern()

Gets the relative labels file pattern.

public getLocalizedLabelsPathPattern(string $fileReference) : string

Parameters

$fileReference : string

Tags

throws
InvalidArgumentException

Return values

string

getSupportedExtensions()

Get supported extensions

public getSupportedExtensions() : array

Return values

array

hasData()

Checks if the store contains parsed data.

public hasData(string $fileReference, string $languageKey) : bool

Parameters

$fileReference : string

File reference

$languageKey : string

Valid language key

Return values

bool

initialize()

Initializes the current class.

public initialize() : mixed

setConfiguration()

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

public setConfiguration(string $fileReference, string $languageKey) : LanguageStore

Parameters

$fileReference : string

File reference

$languageKey : string

Valid language key

Tags

throws
InvalidParserException
throws
FileNotFoundException

Return values

LanguageStore —

This instance to allow method chaining

setData()

Sets data for a specific file reference and a language.

public setData(string $fileReference, string $languageKey, array $data) : LanguageStore

Parameters

$fileReference : string

File reference

$languageKey : string

Valid language key

$data : array

Return values

LanguageStore —

This instance to allow method chaining

On this page