PHP Class Neos\Flow\I18n\Xliff\XliffModel
Please note that plural forms for particular translation unit are accessed
with integer index (and not string like 'zero', 'one', 'many' etc). This is
because they are indexed such way in XLIFF files in order to not break tools'
support.
There are very few XLIFF editors, but they are nice Gettext's .po editors
available. Gettext supports plural forms, but it indexes them using integer
numbers. Leaving it this way in .xlf files, makes it possible to easily convert
them to .po (e.g. using xliff2po from Translation Toolkit), edit with Poedit,
and convert back to .xlf without any information loss (using po2xliff).
Mostra file
Open project: neos/flow-development-collection
Class Usage Examples
Protected Properties
Property |
Type |
Description |
|
$cache |
Neos\Cache\Frontend\VariableFrontend |
|
|
$i18nLogger |
Neos\Flow\Log\LoggerInterface |
|
|
$locale |
Neos\Flow\I18n\Locale |
|
|
$sourcePath |
string |
Absolute path to the file which is represented by this class instance. |
|
$xmlParsedData |
array |
Parsed data (structure depends on concrete model). |
|
$xmlParser |
XliffParser |
Concrete XML parser which is set by more specific model extending this
class. |
|
Public Methods
Method Details
__construct()
public method
public __construct ( string $sourcePath, Locale $locale ) |
$sourcePath |
string |
|
$locale |
Neos\Flow\I18n\Locale |
The locale represented by the file |
getTargetBySource()
public method
Returns translated label ("target" tag in XLIFF) from source-target
pair where "source" tag equals to $source parameter.
getTargetByTransUnitId()
public method
Id is compared with "id" attribute of "trans-unit" tag (see XLIFF
specification for details).
initializeObject()
public method
When it's called, XML file is parsed (using parser set in $xmlParser)
or cache is loaded, if available.
injectCache()
public method
Injects the Flow_I18n_XmlModelCache cache
public injectCache ( Neos\Cache\Frontend\VariableFrontend $cache ) : void |
$cache |
Neos\Cache\Frontend\VariableFrontend |
|
return |
void |
|
injectParser()
public method
Property Details
$cache protected_oe property
protected VariableFrontend,Neos\Cache\Frontend $cache |
return |
Neos\Cache\Frontend\VariableFrontend |
|
$i18nLogger protected_oe property
protected LoggerInterface,Neos\Flow\Log $i18nLogger |
return |
Neos\Flow\Log\LoggerInterface |
|
$locale protected_oe property
protected Locale,Neos\Flow\I18n $locale |
return |
Neos\Flow\I18n\Locale |
|
$sourcePath protected_oe property
Absolute path to the file which is represented by this class instance.
protected string $sourcePath |
return |
string |
|
$xmlParsedData protected_oe property
Parsed data (structure depends on concrete model).
protected array $xmlParsedData |
return |
array |
|
$xmlParser protected_oe property
Concrete XML parser which is set by more specific model extending this
class.
protected XliffParser,Neos\Flow\I18n\Xliff $xmlParser |
return |
XliffParser |
|