Translating gettext

From Apertium
Revision as of 20:53, 22 November 2009 by Unhammer (talk | contribs)
Jump to navigation Jump to search

A combination of pospell and Apertium can be used to translate gettext .po files.

pospell is part of the spellutils package, available through apt-get, macports, emerge, urpmi...

Example

$ cat sv.po | pospell -n - -f -p apertium -- sv-da -u > da.po


Thus if you put

#!/bin/sh
pospell -n - -f -p apertium -- -u "$@"

into a file called eg. "apertium-po", and chmod +x apertium-po, you can do

$ cat sv.po | apertium-po sv-da > da.po

You can also use the Python package Pology. Follow the instructions on the link to set it up, then do something like

 $ pomtrans -f sv -t da -a"&" apertium da.po 

Or you could just use the .po file editor Virtaal, which has an Apertium plugin.

See also