Difference between revisions of "Translating gettext"

From Apertium
Jump to navigation Jump to search
Line 1: Line 1:
==pospell==
 
A combination of <code>pospell</code> and Apertium can be used to translate gettext <code>.po</code> files.
 
 
<code>pospell</code> is part of the <code>spellutils</code> package, available through apt-get, macports, emerge, urpmi...
 
 
===Example===
 
<pre>
 
$ cat sv.po | pospell -n - -f -p apertium -- sv-da -u > da.po
 
</pre>
 
 
Thus if you put
 
<pre>
 
#!/bin/sh
 
pospell -n - -f -p apertium -- -u "$@"
 
</pre>
 
into a file called eg. "apertium-po", and <code>chmod +x apertium-po</code>,
 
you can do
 
<pre>
 
$ cat sv.po | apertium-po sv-da > da.po
 
</pre>
 
 
 
==Pology==
 
==Pology==
 
You can also use the Python package [http://techbase.kde.org/Localization/Tools/Pology Pology]. Follow the instructions on the link to set it up, then do something like
 
You can also use the Python package [http://techbase.kde.org/Localization/Tools/Pology Pology]. Follow the instructions on the link to set it up, then do something like
Line 43: Line 22:
   
 
pomtrans can also work recursively on directories, and will mark any MT output as fuzzy, while skipping already-translated text.
 
pomtrans can also work recursively on directories, and will mark any MT output as fuzzy, while skipping already-translated text.
  +
 
==pospell==
 
A combination of <code>pospell</code> and Apertium can also be used to translate gettext <code>.po</code> files.
  +
: I had some trouble with this when I tried, pology worked perfectly however. --[[User:Unhammer|unhammer]] 08:44, 15 September 2010 (UTC)
  +
 
<code>pospell</code> is part of the <code>spellutils</code> package, available through apt-get, macports, emerge, urpmi...
  +
 
===Example===
 
<pre>
 
$ cat sv.po | pospell -n - -f -p apertium -- sv-da -u > da.po
 
</pre>
  +
 
Thus if you put
 
<pre>
 
#!/bin/sh
 
pospell -n - -f -p apertium -- -u "$@"
 
</pre>
 
into a file called eg. "apertium-po", and <code>chmod +x apertium-po</code>,
 
you can do
 
<pre>
 
$ cat sv.po | apertium-po sv-da > da.po
 
</pre>
  +
   
 
==Virtaal==
 
==Virtaal==

Revision as of 08:44, 15 September 2010

Pology

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

 $ pomtrans -s sv -t da apertium da.po 

Note: this assumes the source language of da.po is "sv", an unusual situation... more likely you'll have an sv.po file and a da.po file, in which case the command is:

 $ pomtrans -s sv -t da -p sv.:da. apertium da.po

In case you want to use a mode that's not named like "sl-tl", like "nb-nn_a", apply this patch and use the -M option:

 $ pomtrans -s nb -t nn -p nn.:nb. -M nb-nn_a apertium nn.po

(this again assumes that there's an nb.po file in the same directory)

You might also want to specify the path to apertium (eg. if you installed apertium in /usr/local, not /usr), and the accelerator Key; the full command then becomes:

 $ pomtrans -s nb -t nn -p nn.:nb. -M nb-nn_a -T /usr/local/bin/apertium -a "&" apertium nn.po

pomtrans can also work recursively on directories, and will mark any MT output as fuzzy, while skipping already-translated text.

pospell

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

I had some trouble with this when I tried, pology worked perfectly however. --unhammer 08:44, 15 September 2010 (UTC)

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


Virtaal

Or you could just use the .po file editor Virtaal, which has an Apertium plugin. (So far this only works with the web service, but later version might be able to use local installations.)

See also