interface TranslationProviderInterface (View source)

An interface for providers of translation labels (messages).

Concrete implementation may throw an UnsupportedTranslationMethodException if particular method is not available / implemented.

Methods

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

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

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