Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Edit this page
Toggle table of contents sidebar

# ts2po

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.

Note

Virtaal and Pootle can edit .ts files directly without the need for any conversion.

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.

## Usage

    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):

`--version`

  show program’s version number and exit

`-h, --help`

  show this help message and exit

`--manpage`

  output a manpage based on the help

`--progress=PROGRESS`

  show progress as: dots, none, bar, names, verbose

`--errorlevel=ERRORLEVEL`

  show errorlevel as: none, message, exception, traceback

`-i INPUT, --input=INPUT`

  read from INPUT in ts format

`-x EXCLUDE, --exclude=EXCLUDE`

  exclude names matching EXCLUDE from input paths

`-o OUTPUT, --output=OUTPUT`

  write to OUTPUT in po, pot formats

`-S, --timestamp`

  skip conversion if the output file has newer timestamp

`-P, --pot`

  output PO Templates (.pot) rather than PO files (.po)

`--duplicates=DUPLICATESTYLE`

  what to do with duplicate strings (identical source text): merge, msgctxt (default: ‘msgctxt’)

Options (po2ts):

`--version`

  show program’s version number and exit

`-h, --help`

  show this help message and exit

`--manpage`

  output a manpage based on the help

`--progress=PROGRESS`

  show progress as: dots, none, bar, names, verbose

`--errorlevel=ERRORLEVEL`

  show errorlevel as: none, message, exception, traceback

`-i INPUT, --input=INPUT`

  read from INPUT in po, pot formats

`-x EXCLUDE, --exclude=EXCLUDE`

  exclude names matching EXCLUDE from input paths

`-o OUTPUT, --output=OUTPUT`

  write to OUTPUT in ts format

`-t TEMPLATE, --template=TEMPLATE`

  read from TEMPLATE in ts format

`-S, --timestamp`

  skip conversion if the output file has newer timestamp

`-c CONTEXT, --context=CONTEXT`

  use supplied context instead of the one in the .po file comment

## Examples

    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.

## Bugs

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.