PHP Class Neos\Neos\Service\XliffService

Show file Open project: neos/neos-development-collection Class Usage Examples

Protected Properties

Property Type Description
$localizationService Neos\Flow\I18n\Service
$packageManager Neos\Flow\Package\PackageManagerInterface
$packagesRegisteredForAutoInclusion array
$scrambleTranslatedLabels boolean
$xliffBasePath string A relative path for translations inside the package resources.
$xliffParser Neos\Flow\I18n\Xliff\XliffParser
$xliffToJsonTranslationsCache Neos\Cache\Frontend\VariableFrontend

Public Methods

Method Description
getCacheVersion ( ) : integer
getCachedJson ( Locale $locale ) : Neos\Error\Messages\Result Return the json array for a given locale, sourceCatalog, xliffPath and package.
parseXliffToArray ( string $xliffPathAndFilename, string $packageKey, string $sourceName ) : array Read the xliff file and create the desired json

Protected Methods

Method Description
setArrayDataValue ( array &$arrayPointer, string $key, string $value ) : void Helper method to create the needed json array from a dotted xliff id

Method Details

getCacheVersion() public method

public getCacheVersion ( ) : integer
return integer The current cache version identifier

getCachedJson() public method

The json will be cached.
public getCachedJson ( Locale $locale ) : Neos\Error\Messages\Result
$locale Neos\Flow\I18n\Locale The locale
return Neos\Error\Messages\Result

parseXliffToArray() public method

Read the xliff file and create the desired json
public parseXliffToArray ( string $xliffPathAndFilename, string $packageKey, string $sourceName ) : array
$xliffPathAndFilename string The file to read
$packageKey string
$sourceName string
return array

setArrayDataValue() protected method

Helper method to create the needed json array from a dotted xliff id
protected setArrayDataValue ( array &$arrayPointer, string $key, string $value ) : void
$arrayPointer array
$key string
$value string
return void

Property Details

$localizationService protected property

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

$packageManager protected property

protected PackageManagerInterface,Neos\Flow\Package $packageManager
return Neos\Flow\Package\PackageManagerInterface

$packagesRegisteredForAutoInclusion protected property

protected array $packagesRegisteredForAutoInclusion
return array

$scrambleTranslatedLabels protected property

protected bool $scrambleTranslatedLabels
return boolean

$xliffBasePath protected property

A relative path for translations inside the package resources.
protected string $xliffBasePath
return string

$xliffParser protected property

protected XliffParser,Neos\Flow\I18n\Xliff $xliffParser
return Neos\Flow\I18n\Xliff\XliffParser

$xliffToJsonTranslationsCache protected property

protected VariableFrontend,Neos\Cache\Frontend $xliffToJsonTranslationsCache
return Neos\Cache\Frontend\VariableFrontend