class XliffTranslationProvider implements TranslationProviderInterface (View source)

The concrete implementation of TranslationProviderInterface which uses XLIFF file format to store labels.

Properties

protected XliffFileProvider $fileProvider
protected PluralsReader $pluralsReader

Methods

void
injectFileProvider(XliffFileProvider $fileProvider)

No description

void
injectPluralsReader(PluralsReader $pluralsReader)

No description

mixed
getTranslationByOriginalLabel(string $originalLabel, Locale $locale, string $pluralForm = null, string $sourceName = 'Main', string $packageKey = 'Neos.Flow')

Returns translated label of $originalLabel from a file defined by $sourceName.

mixed
getTranslationById(string $labelId, Locale $locale, string $pluralForm = null, string $sourceName = 'Main', string $packageKey = 'Neos.Flow')

Returns label for a key ($labelId) from a file defined by $sourceName.

Details

void injectFileProvider(XliffFileProvider $fileProvider)

No description

Parameters

XliffFileProvider $fileProvider

Return Value

void

void injectPluralsReader(PluralsReader $pluralsReader)

No description

Parameters

PluralsReader $pluralsReader

Return Value

void

mixed getTranslationByOriginalLabel(string $originalLabel, Locale $locale, string $pluralForm = null, string $sourceName = 'Main', string $packageKey = 'Neos.Flow')

Returns translated label of $originalLabel from a file defined by $sourceName.

Chooses particular form of label if available and defined in $pluralForm.

Parameters

string $originalLabel

Label used as a key in order to find translation

Locale $locale

Locale to use

string $pluralForm

One of RULE constants of PluralsReader

string $sourceName

Name of file with translations, base path is $packageKey/Resources/Private/Locale/Translations/

string $packageKey

Key of the package containing the source file

Return Value

mixed

Translated label or false on failure

Exceptions

InvalidPluralFormException

mixed getTranslationById(string $labelId, Locale $locale, string $pluralForm = null, string $sourceName = 'Main', string $packageKey = 'Neos.Flow')

Returns label for a key ($labelId) from a file defined by $sourceName.

Chooses particular form of label if available and defined in $pluralForm.

Parameters

string $labelId

Key used to find translated label

Locale $locale

Locale to use

string $pluralForm

One of RULE constants of PluralsReader

string $sourceName

Name of file with translations, base path is $packageKey/Resources/Private/Locale/Translations/

string $packageKey

Key of the package containing the source file

Return Value

mixed

Translated label or false on failure

Exceptions

InvalidPluralFormException