简体   繁体   中英

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?

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM