Using lrelease-pro

The lrelease-pro command line tool generates QM files from qmake projects (.pro files). It reads the TRANSLATIONS variable from the project file and generates the corresponding QM files.

Use lrelease-pro when you have a qmake project and want to generate QM files based on the translations defined in your .pro file.

lrelease-pro syntax

 lrelease-pro [options] [project-file]...

Where:

To view the latest help, enter:

 lrelease-pro -help

lrelease-pro options

OptionAction
-helpDisplay up-to-date help information and exit.
-dump-json <file>Generate a JSON project description file without generating QM files. This file can be passed to lrelease using the -project option.
-silentDo not explain what is being done.
-removeidenticalIf the translated text is the same as the source text, exclude the message.
-fail-on-unfinishedGenerate an error if unfinished translations are found.
-fail-on-invalidFail if translations failing the following checks are found:
  • validity check of accelerators
  • validity check of surrounding whitespaces
  • validity check of ending punctuation
  • validity check of place markers

To get more details refer to Qt Linguist help

-nounfinishedDo not include unfinished translations.
-markuntranslated <prefix>If a message has no real translation, use the source text prefixed with the given string instead.
-versionDisplay the version of lrelease-pro and exit.

Examples

Generate QM files from a qmake project

 lrelease-pro myproject.pro

Generate JSON project description

Generate a JSON file describing the project's translations:

 lrelease-pro myproject.pro -dump-json project.json

Then use the generated JSON file with lrelease:

 lrelease -project project.json