0

I have implemented a local service that allows converting multiple formats like html, docx, xlsx, tmx... to XLIFF. After performing a specific process with xlf generated file I want to get it back to its original format. I use okapi libraries for this purpose and all works properly.

I would like to know if okapi implements a mechanism to convert xlf to its original file format, speciall xlf to html (this format is mandatory for me).

Is there any suitable approach?

Thanks in advance

Jenszcz
  • 547
  • 3
  • 9

2 Answers2

2

Yes, this is generally possible. Okapi calls it merging, and it requires that the source HTML (or other format) file is available in addition to the translated XLIFF.

A common method for doing this is to use a pair of rainbow pipelines. The first ("extraction") pipeline looks like this:

  • Raw Document to Filter Events
  • [Other steps, such as segmentation, are optional here]
  • Rainbow Translation Kit Creation (select "Generic XLIFF" as the type)

This will generate a "translation kit" containing the source file, an extracted XLIFF, and some metadata in a file called manifest.rkm. You can then modify the XLIFF to perform the translation, etc. Then, use another pipeline to perform the merge:

  • Raw Document to Filter Events
  • Rainbow Translation Kit Merging

Sort of confusingly, the source file for this merge pipeline should be the manifest.rkm file for the translation kit, not the XLIFF or the source file. Okapi will parse the manifest and figure out where everything else is, then merge the translations from the XLIFF back into a new output copy of the HTML.

This process can fail if you do sufficiently gruesome things to the XLIFF that Okapi can't figure out how to map the translated segments back to the original document any more.

A quick-and-dirty way to do this same thing, without the kit, is to use the tikal command-line tool that is bundled with Okapi. First, use this to extract test.html to test.html.xlf:

tikal.sh -fc okf_html -x test.html

Then, merge the translated test.html.xlf to an output test.out.html:

tikal.sh -fc okf_html -m test.html.xlf
Chase T
  • 116
  • 5
0

I do not understand your question: can you convert files back or not? I assume not, and that's what this answer is about.

The Okapi doc at http://www.opentag.com/okapi/wiki/index.php?title=Rainbow says: There are filters for many formats, for example: OpenOffice, XML, HTML, Properties, DTD, MS Office, tables, etc.

To convert XLIFF files back to their original format you have to add the Filter Events to Raw Document Step to your command pipeline. There are two filter configurations available for HTML, and one for HTML 5.

Jenszcz
  • 547
  • 3
  • 9