Convert Gettext PO files to a TMX translation memory file. TMX is the Translation Memory eXchange format developed by OSCAR.
If you are interested in po2tmx, you might also be interested in posegment that can be used to perform some automated segmentation on sentence level.
po2tmx [options] --language <target> <po> <tmx>
Where:
<po> |
is a PO file |
<tmx> |
is a TMX file |
Options:
show program’s version number and exit
show this help message and exit
output a manpage based on the help
show progress as: dots, none, bar, names, verbose
show errorlevel as: none, message, exception, traceback
read from INPUT in po, pot formats
exclude names matching EXCLUDE from input paths
write to OUTPUT in tmx format
skip conversion if the output file has newer timestamp
set target language code (e.g. af-ZA) [required]
set source language code (default: en)
set default comment import: none, source, type or others (default: none)
po2tmx -l xh browser.po browser.tmx
Use the Xhosa (xh) translations in the PO file browser.po to create a TMX file called browser.tmx
po2tmx conforms to TMX v1.4 without stripping markup. See the TMX conformance page for more details.
It has not been widely tested so your mileage may vary.
In some tools, like OmegaT, PO files are parsed without expanding escaped
sequences, even though such tools use TMX for translation memory. Keep this in
mind when using po2tmx, because po2tmx converts \n
and \t
to newlines
and tabs in the TMX file. If such a TMX file is used while translating PO
files in OmegaT, matching will be less than 100%.
In other tools, such as Swordfish, the PO comment “no-wrap” is interpreted in the same way as the equivalent function in XML, which may also lead to mismatches if TMXes from po2tmx are used.
There is nothing wrong with po2tmx, but if used in conjunction with tools that handle PO files differently, it may lead to less than perfect matching.
To create a TMX with no duplicates (in other words, only unique strings), use msgcat to first create a large PO file with non-uniques removed.