Plugins and Manifest¶
Plugins¶
A plugin is just a .jar file, which is stored in <OMEGAT_INSTALLATION>/plugins/ dir or `<OMEGAT_USERPREFERENCES>/plugins/. If a plugin needs to use additional jars, they can be placed in the same directory.
There must be a manifest file that indicates that it is an OmegaT plugin. There are two flavors, see below.
OmegaT 5.8.0 can install a plugin file (jar or zip) from GUI that has mandatory information. You should provide name, version, author, category, and description.
OmegaT 6.1.0 is going to be able to install plugins from remote. You should provide all requested information to support remote installation. The manifest should be a form of OmegaT 3.0.1 and up compliant.
For each there are different manifest entry alternatives, and OmegaT will pick the first one present in the order from left to right as described in the table below:
Attribute |
Manifest entry (pick one) |
|---|---|
Name |
Plugin-Name, Bundle-Name, Implementation-Title |
Version |
Plugin-Version, Bundle-Version, Implementation-Version |
Author |
Plugin-Author, Implementation-Vendor, Built-By |
Description |
Plugin-Description |
Link |
Plugin-Link |
License |
Plugin-License |
Category |
Plugin-Category |
plugins for OmegaT 5.8.0 and up¶
Simple plugin that has a single plugin category¶
A plugin should be declared in the main section of META-INF/MANIFEST.MF:
Plugin-Name: …
Plugin-Version: x.y.z
Plugin-Author: …
Plugin-Description: …
[Plugin-Link: https://..]
Plugin-Category: filter
OmegaT-Plugins: <classname>
where classname is the fully qualified classname of the plugin’s initialization class.
Complex plugin that has multiple drivers in a plugin¶
Plugin-Name: …
Plugin-Version: x.y.z
Plugin-Author: …
[Plugin-Link: https://..]
OmegaT-Plugins: <classnames>
name: org/example/plugin/filter/package/
Plugin-Description: ...
Plugin-Category: filter
name: org.example.plugin.filter.package.ClassName
Plugin-Description: ...
Plugin-Category: filter
Multiple classnames are defined, like in the “Class-Path” attribute, i.e., space separated. There are also several sections that specified details of each plugin class. The package section can be used for specifying category and description for classes in the package. The classname section can be used for specifying category and description for the class. These are useful when you bundles multiple filters/drivers in the plugin, such as OKAPI filter plugin.
Mandatory method in the plugin class¶
The plugin class should contain loadPlugins() and unloadPlugins() methods.
The loadPlugins() method is executed on application startup before any GUI initialization. You can register your
plugin using Core APIs.
Please consult with Loading Plugins and Core Events for details.
Plugin categories¶
Plugin manifest has a mandatory entry Plugin-Category:
[Plugin-Category: filter]
You can choose a value from following list. A value is not affected the plugin behavior but it is used when showing a plugin list on preference dialog.
filter
tokenizer
marker
machinetranslator
base
glossary
dictionary
theme
miscellaneous
When plugin has a value other than above, OmegaT will show it as ‘unknown’ category.
Backward compatibility¶
OmegaT also accepts old plugins in version 5.8.0 and onward. It is not recommended to use old interfaces in the new version of your plugins.
Omegat 5.3.0 also supports providing additional information (valid for both flavors) that can be displayed in the UI. You can optionally provide name, version, author, and description.
OmegaT 5.5.0 can show the plugin name and author in Preferences. You are recommended to set these parameters. You can optionally provide an URL of your plugin home page, license, and category.
plugins for OmegaT 2.1.3 and up¶
A plugin should be declared in META-INF/MANIFEST.MF:
OmegaT-Plugin: true
[Plugin-Name: …]
[Plugin-Version: x.y.z]
[Plugin-Author: …]
[Plugin-Description: …]
Name: my.Class
OmegaT-Plugin: filter
[Name: my.optional.other.Class
OmegaT-Plugin: filter]
plugins for OmegaT 3.0.1 and up¶
A plugin should be declared in META-INF/MANIFEST.MF:
[Plugin-Name: …]
[Plugin-Version: x.y.z]
[Plugin-Author: …]
[Plugin-Description: …]
[Plugin-Link: https://..]
[Plugin-Category: filter]
OmegaT-Plugins: <classname>