Marcel Müller
Marcel Müller

Reputation: 488

Can Qt lrelease tool process XLIFF files instead of ts-files?

In the documentation of the Qt lrelease tool I read, that .ts files can be compiled to .qm binaries using following command:

lrelease.exe main_en.ts languages\main_fr.ts

Is it possible to take .xliff files as well as input instead of the .ts files to compile .xliff files to .qm files? How is it done?

Upvotes: 0

Views: 1132

Answers (2)

Former contributor
Former contributor

Reputation: 2576

To convert a xliff file to ts, you can use the lconvert utility with a command line like this:

lconvert -o converted.ts -i original.xlf 

Here is the output of lconvert -help:

Usage: lconvert [options] [...]

lconvert is part of Qt's Linguist tool chain. It can be used as a stand-alone tool to convert and filter translation data files. The following file formats are supported:

qm    - Compiled Qt translations
pot   - GNU Gettext localization template files
ts11  - Qt translation sources (format 1.1)
ts20  - Qt translation sources (format 2.0)
qph   - Qt Linguist 'Phrase Book'
ts    - Qt translation sources (latest format)
po    - GNU Gettext localization files
xlf   - XLIFF localization files

If multiple input files are specified, they are merged with translations from later files taking precedence.

Options: -h --help Display this information and exit.

-i <infile>
--input-file <infile>
       Specify input file. Use if <infile> might start with a dash.
       This option can be used several times to merge inputs.
       May be '-' (standard input) for use in a pipe.

-o <outfile>
--output-file <outfile>

More info here about this Qt tool

Upvotes: 2

Frodon
Frodon

Reputation: 3775

From the documentation of lupdate, it is mentioned that you can generate .ts file from XLIFF files. You can then use lrelease to generate the .qm file.

Be aware that only the XLIFF 1.1 format is supported, not the 1.0.

Upvotes: 2

Related Questions