Translating Markdown Files
Overview
To make OmegaT work with Markdown files, parse YAML headers, and allow modifying links (these are what my project requires), you need to customize some settings.
To do so, you need to add a filter plugin so that OmegaT can parse markdown files and customize a filter config file to allow translating links and YAML headers.
Instructions
- Download Okapi’s OmegaT filter, which is available here.
- Open OmegaT, click Options > Access configuration files. In the folder that is opened, create a folder called
plugins
and drag the filter downloaded in Step 1 to this folder.
At this stage, OmegaT can already parse markdown files. If you don’t need to translate links or YAML headers, you can skip the steps below.
Download okapi’ Rainbow app (supports macOS and Windows), which is available here.
Create a custom filter config file.
Open Rainbow.
Click Tools > Filter Configurations.
Find Markdown in the Name column, click Create, name your config file as needed (for example,
test
), and click OK. After this, you will get a config file namedokf_markdown@test
, which will be needed later. Note that this file is usually in your home directory (in my case,Users/vickyhella/
).Customize the config file as needed. For example, I need it to allow translating the links and YAML header, so I checked the Translate Hyperlink URLs extracted as a subflow and Translate YAML Metadata Header boxes.
You can customize your settings as needed. However, I haven’t tried other settings yet, so this document will not cover those other settings. Once I tried them out, I will put the tutorials here.
- Open OmegaT again and apply the
okf_markdown@test
file created in Step 4.
Now, OmegaT can parse markdown files and allow link/YAML headers translation.
Conclusion
After performing the steps above, you should be able to translate markdown files as needed.
However, the translated file format might not be exactly the same as the source file (for example, the indentation could be different). This is caused by the Okapi filter itself. Therefore, translators should always preview the translated file and modify the format if needed to ensure the source and target files have the same format.