PHP Class Neos\Flow\I18n\TranslationProvider\XliffTranslationProvider

Inheritance: implements Neos\Flow\I18n\TranslationProvider\TranslationProviderInterface
Afficher le fichier Open project: neos/flow-development-collection

Protected Properties

Свойство 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.

Méthodes publiques

Méthode 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

Méthodes protégées

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

Method Details

getModel() protected méthode

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
Résultat Neos\Flow\I18n\Xliff\XliffModel New or existing instance

getTranslationById() public méthode

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
Résultat mixed Translated label or FALSE on failure

getTranslationByOriginalLabel() public méthode

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
Résultat mixed Translated label or FALSE on failure

injectLocalizationService() public méthode

public injectLocalizationService ( Service $localizationService ) : void
$localizationService Neos\Flow\I18n\Service
Résultat void

injectPluralsReader() public méthode

public injectPluralsReader ( PluralsReader $pluralsReader ) : void
$pluralsReader Neos\Flow\I18n\Cldr\Reader\PluralsReader
Résultat void

Property Details

$localizationService protected_oe property

protected Service,Neos\Flow\I18n $localizationService
Résultat Neos\Flow\I18n\Service

$models protected_oe property

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

$pluralsReader protected_oe property

protected PluralsReader,Neos\Flow\I18n\Cldr\Reader $pluralsReader
Résultat Neos\Flow\I18n\Cldr\Reader\PluralsReader

$xliffBasePath protected_oe property

An absolute path to the directory where translation files reside.
protected string $xliffBasePath
Résultat string