Convert Qt .ts localization files to Gettext .po format files using ts2po and convert the translated PO Files files back to Qt .ts using po2ts.
The Qt toolkit comes with a localization application, Qt Linguist, however you might wish to standardise on one localization tool. ts2po allows you to standardise on the PO format and PO related tools.
Warning
po2ts uses our older .ts support. Thus many of the newer features in .ts are not supported. To support those features rather edit directly in Virtaal or Pootle.
ts2po [options] <ts> <po>
po2ts [options] <po> <ts>
Where:
<ts> |
is a Qt .ts file or directory that contains .ts files |
<po> |
is a PO file or a directory of PO files |
Options (ts2po):
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 ts format
exclude names matching EXCLUDE from input paths
write to OUTPUT in po, pot formats
skip conversion if the output file has newer timestamp
output PO Templates (.pot) rather than PO files (.po)
what to do with duplicate strings (identical source text): merge, msgctxt (default: ‘msgctxt’)
Options (po2ts):
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 ts format
read from TEMPLATE in ts format
skip conversion if the output file has newer timestamp
use supplied context instead of the one in the .po file comment
ts2po -P psi.ts psi.pot
This will create a POT file called psi.pot from the Qt .ts file called psi.ts.
po2ts af.po psi_af.ts
Now take your translated PO files af.po and convert it into a translated Qt .ts file, psi_af.ts.
Note
You need to use the tools from the Qt toolkit to create the compiled .qm language files for the application.
There are probably still some bugs related to migrating the various attributes across for the different formats. The converters don’t support all the newer features of the TS format, whereas the native support of Virtaal and Pootle is much better.