File Filters


OmegaT features highly customizable filters, enabling you to setup most of the aspects of their work. File filters are pieces of code capable of:

Most of the users should be happy with default file filter options. If you are not, open the main dialog by selecting Options → File Filters... from the main menu. Warning! Changing the filters options when a project is open may cause data loss. If you change filters options when a project is open, you will have to reload the project for the changes to take effect.

File filters dialog

The dialog lists available file filters. If you don't want to use OmegaT to translate the files of some type, you may turn off the filter by checking off the check box near its name. OmegaT will then omit the appropriate files while loading projects, and will copy them untouched while creating target documents. Later when you decide to use the filter again, just tick the check box. Click Defaults to reset the file filters to the default settings. To edit what files in what encodings the filter will process, select the filter from the list and click Edit.

Filters options

Five filters (Text files, XHTML files, HTML and XHTML files, OpenDocument/OpenOffice.org files and Microsoft Open XML files) have one or several specific options. To modify the options select the filter from the list and click on Options. The available options are:

Text files

HTML files and HTML and XHTML Files

OpenDocument/OpenOffice.org files

The following elements can be translated or not. If translated, they will appear as separate segments.

Microsoft Open XML files

The following elements can be translated or not. If translated, they will appear as separate segments.

Edit filter dialog

The dialog allows you to setup the source filename patterns of files the filter will process, customize the filenames of translated files, and select what encodings it will use for loading the file and saving its translated counterpart. To modify a file filter pattern, either modify the fields directly or click Edit. To add a new file filter pattern, click Add. The same dialog is used to add a pattern or to edit a particular pattern. The dialog is useful because it includes a special target filename pattern editor allows you to customize the names of output files.

Source file type, filename pattern

When an OmegaT encounters a file in its source directory, it tries to select the filter using file's extension. More precisely, OmegaT tries to match each filter's source filename patterns against the filename. For example, *.xhtml pattern will match against any file with .xhtml extension. If the appropriate filter is found, it is given the file for processing. For example, by default XHTML filter will be used for processing files with .xhtml extension. You may change or add filename patterns of files each file filter will handle. Source filename patterns use wild card characters similar to those used in Searches. The '*' character matches zero or more characters. The '?' character matches exactly one character. All the other characters represent themselves. For example, if you want the text filter to handle readme files (readme, read.me, and readme.txt) you should use the pattern read*.

Source and target files encoding

Only a limited number of file formats specify a mandatory encoding. File formats that do not specify their encoding will use the encoding you set up for the extension that matches their name. For example, by default .txt files will be loaded using OS-default encoding. You may change the source encoding for each different source filename pattern. Such files may also be written out in any encoding. By default, the translated file encoding in is the same as the source file encoding. Source and target encoding fields use combo boxes with all supported encodings included. <auto> leaves the encoding choice to OmegaT. Here's how it does:

Target filename

Sometimes you may like to rename the files you translate automatically, for example adding a language code after file name. Target filename pattern uses a special syntax, so if you wish to edit this field, you have to click Edit... and use the Edit Pattern Dialog. If you want to fall back to default configuration of the filter, click Defaults. You may also modify the name directly in the target filename pattern field of the file filters dialog. The Edit Pattern Dialog offers the following options:


Legal notices Home Index of contents