OmegaT Console Mode

The purpose of the console mode is to use OmegaT as translation tool in a scripting environment. When started in console mode, no GUI is loaded (so it will work on any console). Depending on the running mode, the given project is automatically translated or a pseudo-translated translation memory is created.


Prerequisites

To run OmegaT, a valid OmegaT-project must be present. The location does not matter, since you have to add it to the command-line at startup anyway.

If you need altered settings, the configuration files must be present. This can be achieved in two ways:

  1. Run OmegaT normally (with the GUI) and set the settings. If you start OmegaT in console mode, it will use the same settings. If you can't run OmegaT normally (no graphical environment available):
  2. copy the settings files from some other OmegaT installation on another machine to a specific directory. The location does not matter, since you can add it to the command-line at startup. The relevant files are filters.conf and segmentation.conf and can be found in the user home directory (E.g. C:\Documents and Settings\%User%\OmegaT under windows, %user%/.omegat/ under Linux)

Starting in console mode

To start OmegaT in console mode, some extra parameters have to be passed on startup. Required are <project-dir> and --mode=<mode>. Optional is --config-dir=<config-dir>.

Depending on the mode, additional parameters have to be (or can be) provided. For mode console-createpseudotranslatetmx the required parameter is --pseudotranslatetmx=<file.tmx> and optional is --pseudotranslatetype=<type>

Example of translate project:
$>java -jar OmegaT.jar /path/to/project --config-dir=/path/to/config-files/ --mode=console-translate
Example of create pseudo translated tmx:
java -jar OmegaT.jar /path/to/project --config-dir=/path/to/config-files/ --mode=console-createpseudotranslatetmx --pseudotranslatetmx=allsegments.tmx --pseudotranslatetype=equal

Explanation:

<project-dir>

tells OmegaT where to find the project. E.g. /home/user/omegat_projects/myProject or "C:\Localization Projects\myProject"

--config-dir=<config-dir>

 allows to tell OmegaT in which directory the configuration files are stored. If not given, OmegaT reverts to default values (OmegaT dir under user home, or if not available: the current working directory).

--mode=[console-translate | console-createpseudotranslatetmx]

 OmegaT starts in console mode. If mode is console-translate it will translate the given project. If mode is createpseudotranslatetmx it will create a transation memory file (specified by parameter --pseudotranslatetmx) that includes all segments of the project, even those segments that were not translated before. The translation of the segments depends on the parameter --pseudotranslatetype. The translation memory equals the OmegaT format, and thus can be used in OmegaT. See also Translation memories

--pseudotranslatetmx=<file.tmx>

 Only valid when mode is console-createpseudotranslatetmx. Specifies to which file the translation memory is written. If the filename does not end with .tmx it will add the extension. The name can be either absolute or relative to the working directory (the directory you start OmegaT from).

--pseudotranslatetype=[empty|equal]

 Only valid when mode is console-createpseudotranslatetmx. Specifies what kind of translation is created for each segment. Possible values are:

  • empty: the target segment will be an empty segment
  • equal: the target segment will be equal to the source segment.

The parameter is optional and defaults to equal.

Extra options

There is one extra command line parameter specific for the console mode: --quiet. In quiet mode, less info is logged to the screen. All messages that you would usually find in the status bar are not shown.
Usage: java -jar OmegaT.jar /path/to/project --quiet


Legal notices Home Index of contents