FileAdapter
class FileAdapter (View source)
A model representing data from an XLIFF file object that may be distributed over several documents in different versions.
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).
Properties
protected LoggerInterface | $i18nLogger | ||
protected array | $fileData | ||
protected Locale | $requestedLocale |
Methods
Returns translated label ("target" tag in XLIFF) from source-target pair where "source" tag equals to $source parameter.
Returns translated label ("target" tag in XLIFF) for the id given.
No description
Details
__construct(array $fileData, Locale $requestedLocale)
No description
mixed
getTargetBySource(string $source, int $pluralFormIndex = 0)
Returns translated label ("target" tag in XLIFF) from source-target pair where "source" tag equals to $source parameter.
mixed
getTargetByTransUnitId(string $transUnitId, int $pluralFormIndex = 0)
Returns translated label ("target" tag in XLIFF) for the id given.
Id is compared with "id" attribute of "trans-unit" tag (see XLIFF specification for details).
array
getTranslationUnits()
No description