OmegaT 6.0.1 - User Manual

# Windows and Dialogs

A window can be kept open next to the editor and lets you interact with both.

A dialog requires you to take action and close it before you can go back to translating.

## Project Properties

Use Project Properties... C + E to open the dialog.

This dialog is used to set the initial project properties when creating a new project or to modify them later, after the project has been created.

See the Create a new project chapter for details.

### Languages

Select the source and target languages from the drop-down list, or enter them manually.

OmegaT provides a convenient short list of two-letter language codes, but you can type any code that conforms to BCP-47 (including the three-letter language codes) into the appropriate field.

Language codes are used in various places in OmegaT to:

- get results in the Fuzzy Matches pane,

- apply the segmentation rules defined in the Global Segmentation Rules preferences,

- find spelling mistakes from the dictionaries installed in the Spellchecker preferences,

- find grammatical and typographical mistakes from the rules set in the LanguageTool preferences,

and so on.

### Warning

Make sure you enter the correct language codes and that all other locations requiring such a code match the one you assign here exactly. Functions that depend on a language either fail or produce incorrect results if there is a mismatch between the language codes.

OmegaT automatically selects the tokenizers that correspond to the source and target languages but you can manually modify those settings. Tokenizers allow OmegaT to provide better matches.

### Options

`Sentence-level segmenting`

  Sentence-level segmentation splits paragraphs or other text blocks in the source file into segments based on segmentation rules.

  Disable this option if you prefer not to further segment the paragraphs.

  By default, segmentation rules are global and apply to all projects.

  Use Options Global Segmentation Rules... to access the global segmentation rules.

  Click on Local Segmentation Rules... to use project-specific (local) segmentation rules rather than the global rules. You can also start OmegaT from the command line with a project specific configuration setting to achieve a similar result.

  See the Command line launch section for details.

  ### Note

  If you use local rules, you can still access the global rules, but modifying them will have no effect on your project.

  Changing the segmentation rules settings during a translation does not modify the segments registered in the project translation memory.

  Switching from sentence to paragraph segmentation mid-translation may force OmegaT to upgrade old translation memories that did not use sentence segmentation, but not vice versa. However, OmegaT will attempt to create fuzzy matches for paragraphs by combining existing sentence translations.

  If you change the segmentation while translating, you will have to reload the project for the new segmentation to take effect. This will split or merge some previously translated segments, which will therefore no longer be translated. However, their original translation will still be in the project memory.

  See the Segmentation appendix for general explanations about segmentation (global or local, paragraph or sentence, settings, and so on).

Local Segmentation Rules...

  By default, segmentation rules are global and apply to all projects.

  The segmentation rules presented when you open the Global Segmentation Rules preferences (using Options Global Segmentation Rules... ) are the global rules.

  Use this button to create local rules specific to your project. Check the `Use local segmentation rules` box, and adjust the segmentation rules as desired.

  The project will store the new set of rules in the segmentation.conf file located in its omegat folder. These rules will supersede the global segmentation rules.

  To disable local segmentation rules, disable this option or remove that file.

  ### Warning

  If you use local rules, you can still access the global rules, but modifying them will have no effect on your project.

  See the Segmentation appendix for general explanations about segmentation (global or local, paragraph or sentence, settings, and so on).

`Auto-propagation of translations`

  If there are repeated segments in the source documents, checking this option will set the first translated segment as the default translation and automatically use the same target text in the remaining repeated segments.

  Use Edit Create Alternative Translation to assign an alternative translation to segments that require a different translation.

  If you do not activate this option, all segments can be assigned a different translation, even if they are duplicated in the project.

`Hide tags`

  Tags are generally useful to reproduce specific layouts or characteristics of the source text in the translated text.

  Activating this function hides the tags in the source segments, freeing you from the need to handle them manually.

  This is especially useful when dealing with texts where inline formatting is not particularly useful (e.g., OCRed PDF, or poorly converted .odt or .docx files.)

  ### Note

  Hidden tags are simply stacked at the end of the segment. Although this does not normally prevent the translated file from opening, keep the following points in mind when using this function:

  - You will have to manually apply bold, italics, or other text decorations in the translated file.

  - If you simply want to reduce the number of tags in a Microsoft Word (2007 and later) document, you can use the Tagwipe script.

    See the Scripting section for details.

`Local post-processing commands`

  ### Warning

  For security reasons, local post-processing commands are disabled by default.

  See the `Allow local post-processing commands` preferences for details.

  OmegaT can automatically run commands after the target files have been created.

  Enter the commands you want to run in this field.

  Use Project Create Translated Files C + D or Project Create Current Translated File C + S + D to create the target files and trigger the command.

  Commands specified here are only available to this project. They are saved in the omegat.project file. Only enable local post-processing commands if you trust the source of that file.

  The template variables list gives you access to various project data and system variables.

  See the Post-Processing Commands appendix for details.

  You can also define global post-processing commands available to all projects that share the same configuration folder. Such commands are defined in the `Global post-processing commands` preference.

  ### Note

  Local commands are run before global commands.

Local File Filters...

  By default, file filter settings are global and shared by all projects. They are found in the Global File Filters preferences.

  Use this button to create local file filters specific to your project. Check the `Use local file filter settings` box, and adjust the settings as desired.

  The project will store the new set of file filters in the filters.xml file located in its omegat folder. These settings will supersede the global file filter settings.

  ### Note

  To disable project-specific file filters, uncheck the box or remove that file.

  See the File Filters appendix for details.

Repository Mapping...

  When working on a team project, this window allows you to define the mapping between the remote and local folders.

  See the Repository mappings section of the Set up a team project how-to for details.

Local External Searches

  By default, external searches are global and are shared by all projects. They are defined in the Global External Searches preferences.

  Use this button to create local external searches specific to your project and adjust the settings as desired.

  The project will store the new set of external searches in the finder.xml file located in its omegat folder. These settings will supersede the global external searches settings.

  To delete project specific external searches, click on the Remove button or remove that file.

  See the Global External Searches preferences for details.

  ### Note

  For security purposes, local project-based external searches are disabled by default. To enable them, check `Allow local external search commands` in the Global External Searches preferences.

### File locations

An OmegaT translation project consists of a number of resources in separate folders.

When a new project is created, OmegaT proposes a default project folder structure that contains all the resources used in the translation, but that structure is not compulsory.

Resource folders can be located anywhere on your system, including on shared disks.

See the Project Folder chapter for details.

You can modify the structure of your project by adding or removing files from the folders, or even by changing the folders used by the project at any time, even during the course of the translation.

Use Project Access Project Contents and its submenus to access the locations of the project resources.

Browse

  The Browse button is available for all user-definable project resources.

  ### Note

  Resources do not have to be stored in the default project folder that OmegaT creates. You can select any folder you want to hold your resources, including folders on shared disks.

  Click on the button to select the folder that you want to use instead of the default resource folder.

`Source files folder`

  This folder contains the files that you want to translate. OmegaT tries to read all the files at once, and displays the translatable contents it finds in the editor.

  See the source section for details.

  If the folder is empty, none of the files contain translatable content, or there are no files supported by the available file filters, OmegaT will tell you that the folder is empty.

  Exclusions...

    Click the Exclusions... button to specify files or folders that should be ignored by OmegaT. An ignored file or folder is:

    - not displayed in the Editor pane,

    - not taken into account in the various statistics reports (such as the Tools Statistics command), and

    - not copied to the target folder when the translated files are created.

    The Exclusion patterns dialog allows you to add or remove a pattern, or edit one either by double-clicking it or selecting it and pressing F2 . Use the Apache ant syntax to define exclusions.

`Translation memories folder`

  This folder contains the files that you want to use as reference translation memories. OmegaT tries to read all the files at once, and compares their contents to the segment you are translating.

  See the tm section for details.

  If matches are found, they are displayed in the Fuzzy Matches pane.

`Glossary files folder`

  This folder contains the files that you want to use as reference glossaries. OmegaT tries to read all the files at once, and compares their contents to the segment you are translating.

  See the glossary section for details.

  If matches are found, they are displayed in the Glossaries pane.

  See the Glossaries appendix for details.

`Writable Glossary File`

  The writable glossary is the file that OmegaT uses when you add translated glossary terms to your project with the Edit Create Glossary Entry... C + S + G command.

  It is automatically created the first time a term is added.

  Newly added entries are automatically recognized and displayed if they match terms in the current segment.

  This file is always located in the glossary folder.

`Dictionaries folder`

  This folder contains the files that you want to use as reference dictionaries. OmegaT tries to read all the files at once, and matches their contents to the segment you are translating.

  See the dictionary section for details.

  If matches are found, they are displayed in the Dictionaries pane.

`Translated files folder`

  This is the folder where OmegaT creates the translated files.

  The translated files are the translated versions of the files located in the source folder.

  Segments that have been translated are replaced by their translation and untranslated segments remain in the source language.

  The folder structure mirrors that of the source folder. Files that are not supported by OmegaT’s file filters are copied without modification.

  Use Create Translated Files C + D or Create Current Translated File C + S + D to create the translated files.

  See the target section for details.

`Exported translation memories folder`

  This is the folder where OmegaT copies the current state of the translation in the form of TMX files when you create the translated files.

  ### Note

  By default, that folder is the project folder itself but you can change its location to make it more practical to share exported TM files.

  See the Share TMs how-to for details.

  The TMX files contain only the segments from the files currently stored in the source folder.

  Use Create Translated Files C + D or Create Current Translated File C + S + D to create the translated files and the exported TMX files.

  `Translation memories to export`

    This checkbox lets you choose the formats in which you want OmegaT to create the above TMX files.

    See the Use translation memories how-to for details.

    `OmegaT`

      An “OmegaT” TMX contains the tags created by OmegaT in a form that can only be used properly by an OmegaT project.

    `TMX Level 1`

      A “level 1” TMX removes all tag information and contains only textual data.

    `TMX Level 2`

      A “level 2” TMX contains textual data along with tags encapsulated in a form compatible with other CAT tools.

  See the TMX 1.4b Specification for details.

## Source Files

This window is displayed automatically when OmegaT loads a project, and can be called at any time using Project Source Files... C + L .

The window displays the following information:

- In the window title: the total number of translatable files in the project.

  These are the files present in the source folder in a format that OmegaT is able to recognize.

- As a list: all translatable files in the project.

  Clicking on any file will open it in the Editor pane for translation.

- Each file entry lists its name, file filter type, encoding, and the number of segments it contains

- The total number of segments, the number of unique segments in the whole project, and the number of unique segments already translated are shown at the bottom.

Typing any text opens a Filter field at the bottom of the window where parts of filenames can be entered. You can use arrows to select a file, and press Enter to open it for translation.

### Note

Filenames (the first column) can be sorted alphabetically by clicking the header. You can change the position of a file by selecting it and clicking one of the Move... buttons on the right.

Right-clicking a filename brings up a popup menu that lets you open the source file or the target file (if it exists).

The number of Unique segments is calculated by removing the number of repeated segments from the total number of segments.

The difference between "Number of segments" and "Number of unique segments" provides an approximate idea of the number of repetitions in the text. Use Tools Statistics to obtain more information.

Modifying the segmentation rules may alter the number of segments/unique segments. This, however, should generally be avoided after you have started translating the project. See the Segmentation appendix for details.

The buttons at the bottom of the window can be used to add files to your project:

Add Files...

  Copies the selected files to the source folder and reloads the project to take the new files into account.

Add MediaWiki Page...

  Asks for the URL of the page and downloads it into the source folder.

The two actions are equivalent to using the Project Add Files... and Project Add MediaWiki Page... menu items.

### Note

You can manually edit the omegat.prefs configuration file to prevent the Source Files list window from opening automatically when a project is loaded.

## Text Search

Use Edit Search... C + F to open a new search window and enter the word or phrase you wish to search for in the search field.

You can have several search windows opened at the same time. Hit C + S + F to reuse the most recent search window.

Alternatively, select a word or phrase in the Editor , Fuzzy Matches , or Glossaries pane and use Edit Search... C + F . The selection is automatically entered in the search field.

Click the drop-down arrow of the Search for: field to access the last ten searches.

Click on Search or hit Enter when the search field is selected to start the search.

Matches will be displayed in bold blue characters.

Example 17. Search for ドイツ

    -- 148> | language = [[日本語]]・[[ドイツ語]]
    ---------
    -- 177> [[2001年]]、ドイツの永住権を取得。
    ---------

The search window has its own menus:

- File > Search for Selection ( C + F ): the current selection is inserted in the search field.

- File > Close ( C + W ): close the search window.

- Edit > Insert Source ( C + S + I ): insert the content of the current source segment.

- Edit > Replace with Source ( C + S + R ): replace the contents of the search field with those of the current source segment.

- Edit > Create Glossary Entry ( C + S + G ): add a new glossary item. See Edit Create Glossary Entry... C + S + G for details.

- Edit > Reset Options: reset the search window options.

### Search type

Use the radio buttons to select the type of search.

The following search types are available:

Exact search

  Search for the string exactly as entered in the search field.

  It is equivalent to a web search enclosed in quotation marks.

Keyword search

  Search for segments containing each of the search terms separated by a space.

  It is equivalent to a web search without quotation marks.

  ### Note

  The `*` and `?` characters can be used in both exact and keyword searches:

  - `*` matches zero or more characters, from the current position up to the end of a word.

    The search term `run*`, for example, matches `run`, `runs` and `running`.

  - `?` matches any single character.

    For instance, `run?` matches `runs`, as well as the `runn` portion of `running` or `runner`.

Regular expressions

  Treat the search string as a regular expression.

  Regular expressions are a very powerful way to search for general or complex patterns rather than exact strings. See the Regular expressions appendix for details.

  ### Warning

  The `*` and `?` characters have a special meaning in regular expressions. Therefore, the wild card searches described above only apply to exact and keyword searches.

### Options

Case sensitive

  Only returns results with the same letter case as the search terms.

Space matches nbsp

  Space characters in search terms will match both a normal space and a non-breaking space (\u00A) character.

In source

  Search in the source segments.

In translation

  Search in the target segments.

In notes

  Search in notes attached to segments.

In comments

  Search in comments attached to segments.

Translated or untranslated

  Search in both translated and untranslated segments.

Translated

  Search only in translated segments.

Untranslated

  Search only in untranslated segments.

Display: all matching segments

  Every segment is displayed individually, even if it is a repetition found in either the same document or a different document in the project.

Display: file names

  The name of the file where the segment is found is displayed above each result.

Search in: Project

  Search in the various bilingual resources of the project.

  Select the scope of the search:

  Main Memory

    Include the project memory (project_save.tmx).

  Reference TMs

    Include the translation memories located in the tm folder.

  Glossaries

    Include the glossaries located in the glossary folder.

Search in: Files

  Search in reference files not included in the project resources.

  OmegaT can conduct searches in any file that it can read as source file. See the File Filters chapter for details.

  TMX files are excluded from file searches since OmegaT does not recognize them as a source file format despite supporting them as translation memories.

TM Search Options

  Select additional criteria such as the person who authored or changed the translation, the date and time of translation (modification), or whether to exclude orphan segments.

  ### Warning

  The TM search options only apply to the main memory and not to the reference memories.

  Full/Half-width char insensitive

    Returns results that match both the full- and half-width forms (CJK characters) of the characters in the search terms.

  Number of matching segments

    Sets the maximum number of matches displayed in the search result area.

  Use the Hide Advanced Options button to stop showing the advanced options.

### Results display

Matches are displayed in their order of appearance in the project. For translated segments, the original text is displayed above the translated text. Only the source text is displayed for untranslated segments.

Double-click on a segment to open it in the Editor pane.

You can also use the following shortcuts in the search results:

C + N

  Move to the next segment

C + P

  Move to the preceding segment

C + J

  Jump to the current segment in the editor.

The selected segment is highlighted in green:

Example 18. Select the second match

    -- 148> | language = [[日本語]]・[[ドイツ語]]
    ---------
    -- 177> [[2001年]]、ドイツの永住権を取得。
    ---------

Auto-sync with editor

  The Editor pane synchronizes its display with the selection in the search results

Back to the initial segment on close

  When you close the search windows, the Editor pane automatically goes back to the segment that it displayed before the search was started

### Filter

Click on the Filter button to show only the matching search result segments in the Editor pane. To remove the filter, click on the Remove Filter button at the top of the Editor pane, or reload the project.

## Text Replace

Use Edit Replace... C + K to open a new replace window and enter the word or phrase you wish to search for in the search field.

Alternatively, select a word or phrase in the Editor , Fuzzy Matches , or Glossaries pane and use Edit Replace... C + K . The selection is automatically entered in the search field.

You can have several replacement windows opened at the same time.

Click the drop-down arrow of the Search for: or Replace with: fields to access the last ten items.

Enter the string you want to insert to replace your search term in the Replace with: field and click on Search, or hit Enter if the cursor is still in the field.

Search matches are displayed in bold blue characters, and the modified strings are displayed in orange to show the result of the replacement.

Example 19. Replace a term

    多和田葉子.UTF8
    -- 148> | language = [[日本語]]・[[ドイツ語]]
    <- | language = [[Japonais]]・[[Alllemand]]
    -> | language = [[Japonais]]・[[Allemand]]
    ---------

### Note

At this stage, no replacements have been made yet.

Click one of the following options:

- Replace All: replace every occurrence (after displaying a confirmation window showing the number of occurrences).

- Show replacements filters the entries in the Editor and highlight the parts that will be replaced.

  Click the Replace and Find Next or Find Next button, and click the Finish button to end the replacement operation.

- Close: close the window without making any changes.

The replace window has its own menus:

- File > Search for Selection ( C + F ): the current selection is inserted in the search field.

- File > Close ( C + W ): close the search window.

- Edit > Insert Source ( C + S + I ): insert the content of the current source segment.

- Edit > Replace with Source ( C + S + R ): replace the contents of the search field with those of the current source segment.

- Edit > Create Glossary Entry ( C + S + G ): add a new glossary item. See Edit Create Glossary Entry... C + S + G for details.

- Edit > Reset Options: reset the search window options.

### Search type

Use the radio buttons to select the type of search.

The following search types are available:

Exact search

  Search for the string exactly as entered in the search field.

  It is equivalent to a web search enclosed in quotation marks.

  ### Note

  The `*` and `?` wild card search characters can be used in exact searches:

  - '*' matches zero or more characters, from the current position up to the end of a word. The search term `'run*'`, for example, matches `'run'`, `'runs'` and `'running'`.

  - '?' matches any single character. For instance, `'run?'` matches `'runs'`, as well as the `'runn'` portion of `'running'` or `'runner'`.

Regular expressions

  Treat the search string as a regular expression.

  Regular expressions are a very powerful way to search for general or complex patterns rather than exact strings. See the Regular expressions appendix for details.

  ### Note

  The replacement string supports references to groups defined in the search string. Use `$n` (where `n` is a digit from 1 to 9) in the replacement field to refer to the `nth`group in the search field.

### Options

Case sensitive

  Only returns results with the same letter case as the search terms.

Space matches nbsp

  Space characters in search terms will match both a normal space and a non-breaking space (\u00A) character.

Untranslated

  Also search in untranslated segments.

Show Advanced Options

  Select additional criteria such as the person who authored or changed the translation, the date and time of translation (modification), or whether to exclude orphan segments.

  Full/Half-width char insensitive

    Returns results that match both the full- and half-width forms (CJK characters) of the characters in the search terms.

  Use the Hide Advanced Options button to stop showing the advanced options.

### Results display

Matches are displayed in their order of appearance in the project. For translated segments, the original text is displayed above the translated text. Only the source text is displayed for untranslated segments.

Double-click on a segment to open it in the Editor pane.

You can use the following shortcuts in the search results:

C + N

  Move to the next segment

C + P

  Move to the preceding segment

C + J

  Jump to the current segment in the editor.

The selected segment is highlighted in green.

Auto-sync with editor

  The Editor pane synchronizes its display with the selection in the search results

Back to the initial segment on close

  When you close the search windows, the Editor pane automatically goes back to the segment that it displayed before the search was started

## Align Files

Use Tools Align Files... to access this tool.

OmegaT also offers a command line based alignment mode for key-based formats. See the `--mode=console-align --alignDir=<path>` option for details.

### Warning

The aligner does not allow you to save your work partway through an alignment. Therefore, it is recommended that you divide the files to align into shorter files that you can comfortably align in a single session. Doing so has the added benefit of reducing mismatches in the initial automatic alignment, making the manual correction step smoother.

Alignment is the process of creating a bilingual translation memory from a pair of already translated monolingual documents. Aligning the contents of the files is a four-step process:

1. Specify the source and target languages and select the two files you want to align.

2. The aligner reads the files and attempts to match the segments that correspond to one another in the original and translated texts.

3. Review the results and makes any necessary manual adjustments.

4. Save the result to a TMX file.

The aligner can read all file formats supported by OmegaT.

### Note

If you have a translation project open, the aligner will automatically use the languages from that project, as well the project-specific segmentation rules, if any.

After selecting the language and files, click OK button to bring up the Align window, which shows the results of the automatic alignment.

The main part of the window is divided into three columns:

- Keep: The segment pairs in rows that have this box checked are saved to the translation memory file. Unchecked rows are discarded.

- Source: The segments from the original text.

- Target: The segments from the translated text.

### Settings

In this step, the bottom part of the window presents various parameters and options you can change if the initial alignment looks like it could be improved. It also shows an Average score result for the alignment. As a rule of thumb, the lower that score, the more accurate the alignment. Changing a parameter immediately recalculates the alignment, allowing you to quickly try different combinations to obtain the best results.

The available parameters and options are:

Parameters

Comparison mode

  - Heapwise: This mode compares the documents globally.

  - Parsewise: This mode compares the documents segment by segment. It is only shown when it is available for the files being aligned.

  - ID: This mode applies to files consisting of `key = value` entries. This works even if the order of the keys differs in each file, and when the files have a different number of entries. It is only shown when both selected files are recognized as key=value files.

Algorithm:

  - Viterbi: The default algorithms used to align the documents.

  - Forward-Backward: An alternative algorithm that can be used to align the documents.

  There is no hard-and-fast rule on which algorithm you should choose. Try both, and use the one that yields the better result for your files.

Calculator:

  - Normal: The default statistical distribution used to align the documents.

  - Poisson: An alternative statistical distribution that can be used to align the documents.

  As with the algorithms, there is no hard-and-fast rule on which statistical distribution you should choose. Try both and use the one that yields the better result for your files.

Counter:

  - Character: The basic unit used to determine the size of segments in languages that do not use a space to delimit words.

  - Word: The basic unit used to determine the size of segments in languages that use a space to delimit words.

  The aligner automatically selects the counter based on the source and target languages of files to align. It defaults to Character if at least one of the languages involved does not delimit words with spaces, and to Word otherwise. If you are working with one of each, you can try to switch between the two to see which one yields better results.

Options

Segment

  The aligner uses sentence segmentation by default. Uncheck the check box to use paragraph segmentation. See the Global Segmentation Rules preferences.

Remove Tags

  The aligner includes tags in the segments by default. Uncheck the check box to remove all tags from the alignment and the resulting TMX.

Highlight

  Uncheck the check box to turn off highlighting.

  The aligner uses the regular expression `\d+` to highlight all numbers in the source and target segments.

  You can modify the regular expression to add highlighted parts. See the Regular expressions chapter for details.

Rules...

  Clicking this button lets you edit the segmentation rules that apply to this project. See the Segmentation appendix for details.

  ### Warning

  If you modify the segmentation rules, you will be asked if you want to save those changes when you exit the aligner. The default choice is Yes, which may not be what you want if you edited the global OmegaT segmentation rules.

Filters...

  Clicking this button lets you edit the file filters that apply to this project. See the Global File Filters preferences for details.

  ### Warning

  If you modify the file filters, you will be asked if you want to save those changes when you exit the aligner. The default choice is Yes, which may not be what you want if you edited the global OmegaT file filters.

Pattern...

  This option lets you enter a regular expression to define the pattern used to highlight text in the source and target segments. By default, the aligner uses `\d+` to highlight numbers. If your texts contain other elements that would be useful to highlight, modify the regular expression to include those elements, using the `|` symbol to separate each element.

You can also access the Highlight option and the dialog to modify the pattern from the View menu, and the other options from the Options menu.

In addition, the File menu provides the following commands:

- Save TMX...: This item is grayed out until the next step is complete.

- Reset: This command restores all parameters to their default value. It can also be called by clicking the Reset at the bottom right of the window or pressing C + S + R

- Reload: This command reloads the file from the disk. You can use this command to parse and align the files again if you had to modify their contents.

- Close: This closes the Align dialog. Doing so in this step cancels the alignment without saving any data to a translation memory file. You can also call this command by pressing C + W .

The Edit menu is grayed out in this step.

Once you are satisfied with the results of this step, click the Continue button to proceed to the next one.

### Corrections

Manual adjustments are generally required after the initial automatic alignment process. This generally involves moving segments up or down to align them with the correct segments in the other language, as well as splitting or merging segments. The aligner also allows you to edit the contents of a segment, which can be useful if you notice errors such as a spelling mistake in a segment.

All available actions can be accessed from the Edit menu or by pressing the corresponding shortcut key. The most common actions are also accessible from the buttons at the right of the main pane.

### Note

The shortcut keys are well worth remembering if you use the aligner often or work on large documents, as they allow you to carry out actions very quickly.

To perform an action, select the applicable segment or block of consecutive segments. Individual segments can be selected with the mouse or the arrow keys. Segment blocks can be selected with the mouse by clicking the first segment, and holding the Shift key while clicking the last segment.

Alternatively, you can press the arrow keys while holding Shift to select consecutive segments. The available actions are presented below.

Move Up ( U )

  Moves the selected segment, or block of consecutive segments, up one row.

  This command is also available from the button at the right of the main window pane.

Move Down ( D )

  Moves the selected segment, or block of consecutive segments, down one row.

  This command is also available from the button at the right of the main window pane.

Split ( S )

  If a single segment is selected, this command opens the Split Text dialog. Use the mouse or arrow keys to place the cursor at the location where you want to split the text, and click the OK button or press Enter .

  If two or more segments occupying separate cells in the same row (multi-cell segments containing lines without a Keep check box) are selected, this command will split the selected cells back into separate rows (with a Keep check box).

  This command is also available from the button at the right of the main window pane.

Merge ( M )

  If only one segment is selected, the aligner will merge it with the following segment. If two or more segments are selected, they will all be merged, but remain in separate cells. Calling the command on the same selection one more time merges the contents of all selected cells into a single cell.

  This command is also available from the button at the right of the main window pane.

Edit ( E )

  This command can only be performed on a single segment. Calling this command opens the Edit Text dialog, which allows you to make changes to the text of the segment. Use the OK button to close the dialog when finished. In this dialog, the Enter enters a line break in the text.

  Use C + Enter to close it without using the mouse.

  This command is also available from the button at the right of the main window pane.

Mark Accepted ( A )

  Use this command to confirm that the alignment of the segments in the selected row or block of rows is correct. This highlights the corresponding Keep column in green.

Mark Needs Review ( R )

  Use this command to identify a row or block of rows for which the alignment of the segments is in doubt. This highlights the corresponding Keep column in red.

Clear Mark ( C )

  Use this command to remove one or more marks set by the Mark Accepted or Mark Needs Review commands.

Realign Pending ( C + R )

  If any rows have been marked as accepted, use this command to update the alignment for the remaining rows.

Keep All

  Use this command to check the Keep box for all rows.

Keep None

  Use this command to uncheck the Keep check box for all rows.

Toggle Selected ( K )

  Use this command to switch the Keep check box of the selected row or block of rows from checked to unchecked, or vice versa.

Start Pinpoint Align ( Space )

  If the corresponding segments are several rows apart and you want to quickly align them, use this command to select the first segment and then click on the corresponding segment in the other column.

  You can also use the arrow keys and press Space in the corresponding segment.

  Segments aligned using this method are automatically marked as accepted.

  It can be helpful to run the Realign Pending command after using the pinpoint align command a few times.

After you finish aligning the two columns, click the Save TMX... button to create the translation memory.

### Note

Only rows with a checked Keep box in the first column are saved to the translation memory.

In addition to the Save TMX... button, the bottom part of the Align window in the manual correction step features the same Highlight check box and Pattern... button as in the first step. This option is also accessible from the View menu.

### Warning

There is also a Reset button at the bottom of the window. Use it with caution! Clicking this button will discard all your changes and bring you back to the first step.

## Scripting

Scripts are short programs (similar to macros in office applications) that can be used to automate tasks as well as to extend or customize OmegaT functionality. They can be written by users in any language understood by the underlying Java virtual machine.

The Scripting window allows you to load an existing script and run it on the current project.

Use Tools Scripting... to access the window.

### The script folder

By default, scripts are stored in the scripts/ folder of the OmegaT application folder.

New scripts added there will appear in the list of available scripts in the left-hand panel of the window.

### Warning

If no list of scripts is displayed on the left side of the script editor window, use the Scripting window File > Set Scripts Folder... menu to set the location of the scripts.

Additional scripts can be found here: OmegaT Scripts. Just copy the file to the scripts/ folder.

Some scripts are event -based. The folder containing the scripts includes subfolders corresponding to the available events. You can trigger scripts automatically by placing them in the appropriate subfolder:

application_shutdown

  Scripts in this folder are launched before OmegaT shuts down.

application_startup

  Scripts in this folder are launched as soon as the scripting engine is available, shortly after OmegaT starts.

entry_activated

  Scripts in this folder are launched when editing a new segment. The segment is in the `newEntry>` binding.

new_file

  Scripts in this folder are launched when the editor switches to the next file in the project. The new filename is in the `activeFileName` binding.

new_word

  Scripts in this folder are launched when a new word is edited in the Editor window. The new word is available from the `newWord` binding.

project_changed

  Scripts in this folder are launched when the state of the project changes. An `eventType` object is bound and can take the following values: CLOSE, COMPILE, CREATE, LOAD, or SAVE.

These subfolders are already created in the script folder that comes with the distribution.

### Warning

Scripts are also launched when you are executing other scripts. Consequently, in a large project, an `entry_activated` script is called frequently when a search/replace type of script that loops through all segments is used, rendering the application unresponsive.

### Usage

- Click the name of a script in the list in the left-hand panel. The script is loaded in the editor.

- Click the Run button at the bottom of the window, or press C + R to launch the script immediately.

- To create a shortcut to a script that you use frequently, right-click one of the <1> to <12> buttons at the bottom of the window and select Add Script to assign the script to that number.

  If you want to detach the script from the shortcut, right-click on its button and select Remove Script

- You can then click on the number to run its assigned script. You can also run the script from the Tools Scripting... menu by selecting the applicable menu item or by pressing the associated shortcut ( C + A + F1 to F12 ).

### Warning

Linux users: depending on the configuration of your operating system, you may not have permission to write to the default scripts folder location.

In such cases, you will have to copy or move the script folder to a location for which you have write permissions, such as the configuration folder, if you want to write your own scripts, add new ones, or modify existing ones.

If you do have permission to write to the default folder, make sure you change the name, or make a backup, of any scripts you modify, as they will be overwritten when OmegaT is updated.

### Distributed scripts

OmegaT comes with a number of scripts developed by OmegaT contributors. Use the script editor to open, run, or modify scripts directly, or to write new scripts for your own use.

### Note

The scripts distributed with OmegaT are included for your convenience but are not supported by the OmegaT development team.

Follow the instructions provided in the script itself.

Adapt standard tags

  Adapt standard tags when the Replace with Match command invoked.

Auto Open Last Project

  Automatically open the last used OmegaT project.

Check Same Segment

  Check for identical segments (case sensitive).

Currency Translator

  Translate currencies representation according to the source and target locales.

  This will translate a string like “$123,399.99” to “123 399,99 USD”, for example.

Example - GUI Scripting

  Example of GUI scripting.

Example - Key Binding

  Example of using a keybinding event.

Example - Modify Segment

  Example that shows how to modify a segment.

Example - Search and Replace

  A simple search and replace script.

External spellcheck

  Writes all segments to a file named `[project_name].doc` and opens it in the default word processor for the system. Note that the file is a plain text file. The `.doc` extension simply ensures it opens in the word processor.

Extract Text Content

  Extracts the content of the project to a single text file (one line per segment). See RFE#182 Extracts the content of the projects to text file.

Non-breaking space

  Replace spaces with non-breakable spaces where appropriate in French.

Open Current File

  Open the current source file.

Open Glossary

  Open the writable glossary in an editor.

Open Project Folder

  Open the project folder in the default file manager.

Open TM Folder

  Open the `/tm` folder.

Open project_save.tmx.

  Open project_save.tmx in a text editor.

QA - Check Rules

  QA script.

QA - Identical Segments

  Check for identical segments (case sensitive).

SVN - Cleanup (recursive)

  Perform SVN cleanup on current project or any folder (recursively).

Show Same Segments

  Display a list of segments where the source and target have identical content.

Spellcheck

  Global spell checking.

Strip Bidi Marks

  Remove bidi mark in the current target or in selection.

Strip tags

  Remove tags in the current target or selection.

Switch Colour Theme

  Switch the colour theme used in the editor.

Tag-Free Match

  Replace current target with a tag-free match.

Tagwipe

  Remove extraneous tags from docx documents.

issue_provider_sample.groovy

  (no description)

toolbar.groovy

  (no description)

### References

OmegaT Javadoc

  The OmegaT API documentation.

Groovy

  A dynamic language for the Java Virtual machine. It builds upon the strengths of Java, and adds powerful features inspired by languages like Python, Ruby and Smalltalk. See Apache Groovy for details.

JavaScript

  A prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language that supports the object-oriented, imperative, and functional programming styles. See Practical Nashorn, Part 1: Introducing JavaScript, ECMAScript, and Nashorn and ECMAScript® 5.1 Language Specification.

All languages have access to the OmegaT object model, with the project as the top object. For example, the following Groovy code snippet scans through all segments in every file in the current project and prints out the source and the target text of segments that contain a translation.

    files = project.projectFiles;
    for (i in 0 ..< files.size())
    {
    	for (j in 0 ..< files[i].entries.size())
    	{
    		currSegment = files[i].entries[j];
    		if (project.getTranslationInfo(currSegment))
    		{
    			source = currSegment.getSrcText();
    			target = project.getTranslationInfo(currSegment).translation;
    			console.println(source + " >>>> " + target);
    		}
    	}
    }