PHP Class Neos\Flow\I18n\TranslationProvider\XliffTranslationProvider

Inheritance: implements Neos\Flow\I18n\TranslationProvider\TranslationProviderInterface
Mostra file Open project: neos/flow-development-collection

Protected Properties

Property Type Description
$localizationService Neos\Flow\I18n\Service
$models array This is an associative array with pairs as follow: ['filename'] => $model,
$pluralsReader Neos\Flow\I18n\Cldr\Reader\PluralsReader
$xliffBasePath string An absolute path to the directory where translation files reside.

Public Methods

Method Description
getTranslationById ( string $labelId, Locale $locale, string $pluralForm = null, string $sourceName = 'Main', string $packageKey = 'Neos.Flow' ) : mixed Returns label for a key ($labelId) from a file defined by $sourceName.
getTranslationByOriginalLabel ( string $originalLabel, Locale $locale, string $pluralForm = null, string $sourceName = 'Main', string $packageKey = 'Neos.Flow' ) : mixed Returns translated label of $originalLabel from a file defined by $sourceName.
injectLocalizationService ( Service $localizationService ) : void
injectPluralsReader ( PluralsReader $pluralsReader ) : void

Protected Methods

Method Description
getModel ( string $packageKey, string $sourceName, Locale $locale ) : XliffModel Returns a XliffModel instance representing desired XLIFF file.

Method Details

getModel() protected method

Will return existing instance if a model for given $sourceName was already requested before. Returns FALSE when $sourceName doesn't point to existing file.
protected getModel ( string $packageKey, string $sourceName, Locale $locale ) : XliffModel
$packageKey string Key of the package containing the source file
$sourceName string Relative path to existing CLDR file
$locale Neos\Flow\I18n\Locale Locale object
return Neos\Flow\I18n\Xliff\XliffModel New or existing instance

getTranslationById() public method

Chooses particular form of label if available and defined in $pluralForm.
public getTranslationById ( string $labelId, Locale $locale, string $pluralForm = null, string $sourceName = 'Main', string $packageKey = 'Neos.Flow' ) : mixed
$labelId string Key used to find translated label
$locale Neos\Flow\I18n\Locale Locale to use
$pluralForm string One of RULE constants of PluralsReader
$sourceName string A relative path to the filename with translations (labels' catalog)
$packageKey string Key of the package containing the source file
return mixed Translated label or FALSE on failure

getTranslationByOriginalLabel() public method

Chooses particular form of label if available and defined in $pluralForm.
public getTranslationByOriginalLabel ( string $originalLabel, Locale $locale, string $pluralForm = null, string $sourceName = 'Main', string $packageKey = 'Neos.Flow' ) : mixed
$originalLabel string Label used as a key in order to find translation
$locale Neos\Flow\I18n\Locale Locale to use
$pluralForm string One of RULE constants of PluralsReader
$sourceName string A relative path to the filename with translations (labels' catalog)
$packageKey string Key of the package containing the source file
return mixed Translated label or FALSE on failure

injectLocalizationService() public method

public injectLocalizationService ( Service $localizationService ) : void
$localizationService Neos\Flow\I18n\Service
return void

injectPluralsReader() public method

public injectPluralsReader ( PluralsReader $pluralsReader ) : void
$pluralsReader Neos\Flow\I18n\Cldr\Reader\PluralsReader
return void

Property Details

$localizationService protected_oe property

protected Service,Neos\Flow\I18n $localizationService
return Neos\Flow\I18n\Service

$models protected_oe property

This is an associative array with pairs as follow: ['filename'] => $model,
protected array $models
return array

$pluralsReader protected_oe property

protected PluralsReader,Neos\Flow\I18n\Cldr\Reader $pluralsReader
return Neos\Flow\I18n\Cldr\Reader\PluralsReader

$xliffBasePath protected_oe property

An absolute path to the directory where translation files reside.
protected string $xliffBasePath
return string