Improve XLIFF 2.0 to/from 1.2 conversion

Declined
#438 · Created  · Last updated

Declined pull request

As discussed we will use a new design using ISkeleton and XliffContextGroup annotation to better match existing filters.

Closed by: ·2020-10-01

Description

This PR improves XLIFF 2.0 to XLIFF 1.2 conversion:

  • Extract/merge XLIFF2 metadata.

    XLIFF 2.0 Metadata module elements are converted into XLIFFContextGroup annotations and stored in the Okapi model.

    The extraction requires flattening the <metaGroup>/<meta> elements hierarchy into a flat <context> element list. The flattening is similar to that performed in PropertiesMapper#setMetadata method.

    Metadata at group and file level were previoulsy extracted into properties, this was superseded in favour of extraction into annotations.

    Merging rebuilds the metadata from the annotations akin to PropertiesMapper#buildMetadataObject method.

  • Extract/merge extended elements.

    Foreign elements are converted into properties and stored in the Okapi model.
    The extraction performs a flattening of the element hierarchy similarly to the point above.

  • Enable preserving the segmentation.
    Segment properties are restored after coalescing for code moving.

Limitations

  • XLIFFContextGroup annotations in document parts are not written out by

    the XLIFFFilter at present.

  • During extended elements extraction whitespace is skipped hence not restored during merge

A unit test for XLIFF 2 metadata extraction was added.

Merging was tested modifying example 06 (modifications not committed).

0 attachments

0 comments

Loading commits...