- edited description
Add custom property support to trans-unit and source attributes in XLIFF 1.2 and XLIFF 2.0
Adding custom property to trans-unit/source element. The following code seems to support that but the actual implementation seems to be missing.
TextUnit tUnit = new TextUnit(id, text);
tUnit.setName(name);
tUnit.setProperty(new Property("abc", "def"));
xliffWriter.writeTextUnit(tUnit);
Comments (2)
-
-
XLIFF 1.2 and 2.0 are separate cases as there is no support at all for XLIFF 2.0 with the current
XLIFFWriter
class in the main Okapi project.Instead, there is a whole separate library that supports both the Metadata module and custom extensions (elements and attributes in a private namespace). The library offers writer and reader classes with which one can easily create, read and modify XLIFF 2.0 files.
- The XLIFF Toolkit: https://bitbucket.org/okapiframework/xliff-toolkit
- Creating a XLIFF 2.0 file: https://bitbucket.org/okapiframework/xliff-toolkit/wiki/Creating
- Metadata support: https://bitbucket.org/okapiframework/xliff-toolkit/wiki/Metadata
The main Okapi project has a simple XLIFF 2 filter that currently provides basic support for extraction/merge with
ITextUnit
. We should probably have in a separate helper class the functions to convert back and forth aITextUnit
to/from aUnit
, to facilitate the use of the XLIFF 2 package with the main Okapi resources. - Log in to comment