If you need to run OmegaT on macOS with a set of custom options, it’s possible to do so by running java -jar --your_options /Applications/OmegaT.app/Contents/MacOS/Java/OmegaT.jar in Terminal. This is all great, but if your project is located in a folder that macOS considers restricted and asks you for permissions, such permissions will be granted to Java, not to OmegaT. It means that other Java programs will have those permissions too, even if you didn’t intend it to be so.
You can also add those options by editing the Configuration.properties (OmegaT configuration) as well as the Info.plist (Java configuration) files located inside the OmegaT.app package. But it means that OmegaT will run with them each time you start it, which might not be what you wanted (for instance, if you add a custom config folder or start OmegaT with --no-team option, you probably don’t want it be the new default).
A much better way is to start it using open: open /Applications/OmegaT.app -n --args --your_options
If you have OmegaT.app located elsewhere, just change the path. -n means that it will start a new instance, so you may have more than one projects open at a time. Anything that comes after --args will be interpreted as arguments (options) passed to OmegaT.
It can show the text to be split or merged with or without tags
If tags are to be shown, they can be formatted with a different font color and size to make the actual text more readable
If a split is attempted while text cursor is inside a tag, the script won’t add a rule and will inform the user about it
The preview of the split or merge to be performed now has horizontal borders to make it easier to see the possible result
So, these are the options that can be configured by the user:
enforceProjectSRX = true //if true, the script will make sure project-specific segmentation is enabled
separateMappingRule = true //if true, the script will add a separate group for its rules
showTags = true //if false, tags won't be shown in the confirmation message
paintTags = true //if true, tags will be shown in different font size and color
tagColor = "gray" //tag color
tagSize = 1 //tag size
Comments in those lines should make it pretty clear what option does what. To change an option, go to Tools → Scripting…, then in the list of scripts, select Merge or split segments. In the text area on the right part of the screen, scroll down a bit (to about line 30), find the option you want to change, edit it, press Ctrl+S to save, and run the script.
OmegaT comes bundled with several scripts. Some of them are of little practical use as they are included as examples for users willing to write their own scripts.
The bundled scripts are located in scripts subfolder of the folder where OmegaT is installed. Often the installation is done in a location where a regular user doesn’t have write permissions, which means adding and removing scripts can be complicated.
Luckily, OmegaT permits setting an arbitrary location for scripts. Do that! It can be any location where you can write to. It doesn’t matter if it contains no scripts at the moment: you can add only the ones you need, and only as you need them. It makes sense to place the scripts folder into the OmegaT config folder (the folder where OmegaT stores its settings) just for convenience.
But it can, of course, be any other folder.
Copy the scripts you need to the folder that was set for scripts. If you’re downloading from GitHub, you might need to show the desired script in raw format, and then save the page. If it saves as filename.groovy.txt, just remove the .txt part. If the file got saved in your Downloads folder, just move it into the folder set for your scripts.
In OmegaT, open Tools → Scripting, in the newly open Scripting window select the script you need (left part of the window) and hit Run (lower left corner).
If you need to run a script quite often, there is a way to assign shortcuts to up to 12 scripts: Select the script you want to run with a shortcut Right-click on one of the 12 buttons in the lower part of the Scripting window Select “Add Script”
The script thus installed is available under Tools, or can be run by pressing Control+Shift+Fn (Fn is a function key at the top of the keyboard, n is a number between 1 and 12, and the number on the button in the Scripting window corresponds to the number on the function key)
In my previous post, I shared a small script that selects the current source text in OmegaT. When OmegaT 5.8/6 is released, that script is not going to be needed: this function has been included in the program itself.
There might be a number of situations when the whole text of the current segment’s source is needed for something other than translation itself: performing concordance or web search, writing a translation note in another application, asking your client or project manager about the text, etc.
Currently, in OmegaT it can be achieved in several fairly easy ways:
Selecting the text with the mouse (but who wants to do that?)
Inserting the source text into the target area (Ctrl+Shift+I or Ctrl+Shift+R) and selecting the text there
Unlocking the text caret with F2, and then using arrow buttons and Shift to select the text (If you want to have the caret unlocked by default when you start OmegaT, there’s a way to do it)
All that is fine, but it would be much nicer to have a simple shortcut to select that source text, similar to what Ctrl+A does (which in OmegaT Editor selects everything only in the target field, or the complete textual contents of other panes if the got focus). I’ve written a simple script that does just that, and though scripts can be bound only to Ctrl+Shift+F[1-12] keys, it’s better than not having a shortcut at all. Hopefully, this function might appear in OmegaT itself, but before it happened, here you have it: Get it from SF.net Get it from GitHub
The earlier version of this script was described in this article. Here I’m announcing the update to the script which makes it possible to include:
Segment ID for each segment (applicable only for some file types)
Translator’s ID of the segment’s translation creator
Translator’s ID of the segment’s translation editor
Visual marks to show segments’ uniqueness or repetitions (grayish background, marks 1 or + in the dedicated column: for the first occurrence, or further instances of the repeated segment, respectfully)
Visual marks for alternative translations (different font color, mark a with a different background in the dedicated column)
Visual marks for untranslated segments (mark NT in the dedicated column)
Visual marks for paragraph boundaries (upper border over the source and target text which visually groups the text belonging to the same paragraph)
All of the above features are optional, though they are on by default. To disable or change them, editing the script is required, but all those lines are very easy to understand, they have comments, and are placed almost in the very beginning of the script:
Unlike the earlier version, the script produces the tabular output:
A few years ago I wrote a script that exported the whole OmegaT to an HTML table. I used it a lot myself, and I know quite a few other people found it helpful too. The problem with the table produced by that script was that it had no way to show repeated or alternatively translated segments. I’ve rewritten the script since, but never published an announcement about that new version. Now I did a few more changes, and thought that it’s about time to fix that omission.