Okapi Filters Plugin for OmegaT

From Okapi Framework
Revision as of 07:44, 20 April 2017 by Amake (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


OmegaT is a free and open-source translation tool that offers support for many file formats. It also provides a plugin mechanism to use addition filters.

Several of the Okapi filters have been packaged into a plugin that works with OmegaT's plugin interface. This allows you to use the filters seamlessly directly from OmegaT.

Filters Included

Currently support for the following formats are included:

Warning: Note that the TTX filter is set by default to auto-detect pre-segmented files.
  • If no segments are detected, the filter extract all text by creating its own TTX segmentation.
  • If one or more segments are detected only the existing segments are passed to OmegaT. So if a file is only half segmented you will not get the un-segmented text in OmegaT. In those cases you can:
    • define your own filter settings file for TTX
    • use Rainbow to create an OmegaT project where the TTX filter is forced to extract the non-segmented text.

Note that several of the formats supported by the plug-in are also supported by OmegaT native filters. You should select which filter to use by enable/disable it in the File Filters dialog. If several filters are set for a given format, the first one in the list is used by default.

Filter Parameters

Starting in m24 you can specify a custom filter parameters file for each of the filter that supports options.

Use OmegaT's Options button in the File Filters dialog box to select whether you want to use the default settings, or a custom filter parameters file (.fprm extension) where you have stored your options.

You cannot create or edit the filter parameters file from OmegaT, but you can use Rainbow to do this (menu Tools > Filter Configurations).

  • All filter parameters files you use in OmegaT must be in the same directory.
  • Make sure the parameters files have the extension .fprm and start with the filter identifier. For example: okf_idml@myConfig.fprm, not just myConfig.fprm.


  • Starting with m24, make sure you are using Java 1.7 or above (OmegaT 3.6 and earlier can run on lower versions of Java).
  • Make sure you have OmegaT 2.2.3 or above.
    • OmegaT 4.0.0+ requires version 1.0-m30+ of this plugin.

Download and Installation

Download the file okapiFiltersForOmegaT-<version>-dist.zip from:

To install the plugin:

  • Locate your OmegaT plugins directory (see your platform below).
  • Copy the plugin's JAR file to the plugins directory.
  • Restart OmegaT.
  • Some file formats (like XLIFF, HTML, etc.) have already native OmegaT filters. OmegaT uses the first enabled filter available. So if you want, for example, OmegaT to use the Okapi XLIFF filter rather than the native OmegaT XLIFF filter, make sure to disable (uncheck) the OmegaT native filter in the File Filters dialog (menu: Options > File Filters).


On Windows you can install the plugin to the plugins directory where OmegaT is installed (e.g. C:\Program Files\OmegaT) or to your Application Data directory:

  • Windows XP: C:\Documents and Settings\<username>\Application Data\OmegaT
  • Windows Vista or later: C:\Users\<username>\AppData\Roaming\OmegaT

Mac OS X

On OS X you are recommended to install the plugin to /Users/<username>/Library/Preferences/OmegaT/plugins. The Library folder in your home directory may be hidden; to access it from the Finder, select Go > Go to Folder from the main menu and enter ~/Library/Preferences/OmegaT/plugins.

Okapi requires Java 1.7. The Mac-specific version of OmegaT 3.1.9 or later is bundled with Java 1.8, so you don't need to do anything. If you are running a "without JRE" version or an older version, you will have to install Java 1.7 or later and ensure that OmegaT is launched with it.

Linux & BSD

On Linux and BSD you can install the plugin to the plugins directory where OmegaT is installed (alongside OmegaT.jar) or to ~/.omegat/plugins.


For the file formats that represent segments, such as TTX, be aware that the segmentation created by OmegaT is not carried back into the translated document. For example, an unsegmented paragraph of two sentences may be translated as two separate segments in OmegaT (and produce two TM entries), but it is merged back as a single paragraph (between segment markers because that is the only way to store translation) in the translated TTX file.

You can use the Segmentation Step in Rainbow, or the Segmentation command of Tikal to create a pre-segmented TTX file before opening it in OmegaT.

Note that any line-break in the source text is considered a segment break by Trados TagEditor, even when it is within an existing segment. Opening a segment that includes a line-break with TagEditor results in a segment withing segment.


TTX documents may contain segments that are already translated. The translation of such segments is loaded as the current translation in OmegaT.

Note that the target language of the OmegaT project must match the target language specified in the TTX file. The target language of a TTX file is defined in the attribute TargetLanguage of the <UserSettings> element.

Testing a Filter

Some file formats are difficult to extract and merge. If you want to be sure that the translated file merges back properly and is a valid file. One step toward verifying this is to re-extract the merged file and compare the first extraction with the second.

  • Open the original file in OmegaT
  • Save it.
  • Go to the target directory and copy the file you have saved some place else.
  • Go back to OmegaT and open the file you have just copied.
  • Both files should have the exact same source content. If they do not it is likely that the saved file was not generated properly. You should fill a bug report to make sure the problem is corrected.

Support for XLIFF 2

Note: This feature is available starting from the version 0.25 and is beta.
  • Only basic core support is implemented
  • The translate='no' attribute in unit or annotations is not supported yet.
  • The canResegment='no' flags are not supported yet.
  • Annotations are stripped out
  • No module is supported yet
  • Existing target is set as OmegaT "fuzzy match" if its status is "initial" or "translated", not fuzzy for "reviewed" and "final".
  • Inline codes are mapped to <gN>/</gN> and <xN/> for now.
  • Notes are not displayed in OmegaT.
  • etc.

You can find examples of valid XLIFF 2 documents in the SVN repository of the XLIFF TC


With this plugin installed I get an error when opening my OmegaT project

If the error is java.lang.NoSuchMethodError: org.omegat.filters2.FilterContext.getProjectProperties()Lorg/omegat/core/data/ProjectProperties; then you are using an older version of this plugin with a newer version of OmegaT (see #Requirements). Update your plugin.