Difference between revisions of "Translating QT Linguist TS-files"

From Apertium
Jump to navigation Jump to search
(Created page with '[http://translate.sourceforge.net/wiki/virtaal/features Virtaal] can handle QT Linguist files and uses the Apertium web service. But if you want to do it with a local installatio…')
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
[http://translate.sourceforge.net/wiki/virtaal/features Virtaal] can handle QT Linguist files and uses the Apertium web service. But if you want to do it with a local installation, it should be fairly easily scriptable.
+
[http://translate.sourceforge.net/wiki/virtaal/features Virtaal] can handle '''QT Linguist''' [http://developer.qt.nokia.com/doc/qt-4.8/linguist-ts-file-format.html TS-files] and uses the Apertium web service. But if you want to do it with a local installation, it should be fairly easily scriptable.
   
 
The following command assumes you want to translate the contents of the <translation> part of es.ts from Spanish to Catalan, and produces a file ca.ts with translations from the <source> language (typically English) to Catalan:
 
The following command assumes you want to translate the contents of the <translation> part of es.ts from Spanish to Catalan, and produces a file ca.ts with translations from the <source> language (typically English) to Catalan:
Line 5: Line 5:
 
paste es.ts <(apertium -u -f html es-ca < es.ts) | sed '/<translation/s,^.*\t,,' |sed 's/\t.*//' > ca.ts
 
paste es.ts <(apertium -u -f html es-ca < es.ts) | sed '/<translation/s,^.*\t,,' |sed 's/\t.*//' > ca.ts
 
</pre>
 
</pre>
It also assumes all &gt;translation&lt; elements are one-line.
+
It also assumes all &lt;translation&gt; elements are one-line.
   
 
==See also==
 
==See also==
 
* [[Format handling]]
 
* [[Format handling]]
  +
* [[Tips for translators]]
 
   
 
[[Category:Tools]]
 
[[Category:Tools]]

Latest revision as of 09:12, 30 May 2014

Virtaal can handle QT Linguist TS-files and uses the Apertium web service. But if you want to do it with a local installation, it should be fairly easily scriptable.

The following command assumes you want to translate the contents of the <translation> part of es.ts from Spanish to Catalan, and produces a file ca.ts with translations from the <source> language (typically English) to Catalan:

paste es.ts <(apertium -u -f html es-ca < es.ts) |  sed '/<translation/s,^.*\t,,' |sed 's/\t.*//' > ca.ts

It also assumes all <translation> elements are one-line.

See also[edit]