OpenXLIFF Filters

OpenXLIFF Filters logo

An open source set of Java filters for creating, merging and validating XLIFF 1.2 and 2.0 files.

The source code of OpenXLIFF Filters is available under the Eclipse Public License v1.0 at https://github.com/rmraya/OpenXLIFF. Anyone can download, compile, modify and use the source code free of charge under the terms of the license.

Features

With OpenXLIFF Filters you can:

  • Create XLIFF files that don't use proprietary markup.
  • Merge translated XLIFF files to generate translated documents.
  • Validate XLIFF files.
  • Generate statistics with word and segment counts plus a graphical display of matches distribution.
  • Combine multiple XLIFF files into a larger one.
  • Pseudo-translate XLIFF files to test conversion/merge processing.
  • Copy the content of <source> elements to new <target> elements for all untranslated segments
  • Approve all segments that contain translations
  • Remove all <target> elements from an XLIFF file
  • Export Approved Segments as TMX

XLIFF 1.2 files generated by OpenXLIFF are fully compatible with Swordfish Translation Editor and most CAT tools.

Project XLIFF Manager implements an easy to use UI for creating/merging XLIFF files in a graphical environment.

Supported File Formats

General Documentation

  • Adobe InCopy IDML
  • Adobe InDesign Interchange (INX)
  • Adobe InDesign IDML CS4, CS5, CS6 & CC
  • HTML
  • Microsoft Office (2007 and newer)
  • Microsoft Visio XML Drawings (2007 and newer)
  • MIF (Maker Interchange Format)
  • OpenOffice / LibreOffice / StarOffice
  • Plain Text
  • SDLXLIFF (Trados Studio)
  • SRT Subtitles
  • Trados Studio packages
  • GlobalLink/WordfastPRO TXML (*.txml)
  • GlobalLink/WordfastPRO XLIFF (*.txlf)
  • WPML XLIFF (WordPress Multilingual Plugin)
  • XLIFF from Other Tools (*.mqxliff, *.xliff)

XML Formats

  • XML (Generic)
  • DITA 1.0, 1.1, 1.2 and 1.3
  • DocBook 3.x, 4.x and 5.x
  • SVG
  • Word 2003 ML
  • XHTML

Software Development

  • JavaScript
  • Java Properties
  • JSON
  • PHP Arrays
  • PO (Portable Objects)
  • RC (Windows C/C++ Resources)
  • ResX (Windows .NET Resources)
  • TS (Qt Linguist translation source)

Requirements

  • JDK 21 or newer is required for compiling OpenXLIFF Filters.
  • Apache Ant 1.10.12 or newer is required for building.

Building

  1. Checkout OpenXLIFF Filters repository from https://github.com/rmraya/OpenXLIFF.
  2. Point your JAVA_HOME variable to JDK 21.
  3. Execute ant.

Steps for building:

git clone https://github.com/rmraya/OpenXLIFF.git 
cd OpenXLIFF
ant

A binary distribution will be created in /dist folder.

Converting Documents to XLIFF

You can use the library in your own Java code. Conversion to XLIFF is handled by the class com.maxprograms.converters.Convert.

If you use binaries from the command line, running .\convert.cmd or ./convert.sh without parameters displays help for XLIFF generation.

Converting XLIFF to Original Format

You can convert XLIFF files created with OpenXLIFF Filters to original format using class com.maxprograms.converters.Merge in your Java code.

If you use binaries from the command line, running .\merge.cmd or ./merge.sh without parameters will display the information you need to merge an XLIFF file.

Validating XLIFF Files

The original XLIFFChecker code supports XLIFF 1.0, 1.1 and 1.2. The new version incorporated in Open XIFF Filters also supports XLIFF 2.0.

All XLIFF 2.0 modules are validated using XML Schema validation.

Standard XML Schema validation does not detect the use of duplicated 'id' attributes, wrong language codes and other constraints written in the different XLIFF specifications.

Extra validation is performed for XLIFF 2.0 Core and for Metadata, Matches and Glossary modules.

You can use the library in your own Java code. validation of XLIFF files is handled by the class com.maxprograms.validation.XLIFFChecker.

Translation Status Analysis

This library lets you produce an HTML file with word counts and segment status statistics from an XLIFF file.

If you use binaries from the command line, running .\analysis.cmd or ./analysis.sh without parameters displays help for statistics generation.

You can generate statistics using your own Java code. Statistics generation is handled by the class com.maxprograms.stats.RepetitionAnalysis.