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:
optionsmeans one or several lrelease-pro options.project-fileis a .pro file to process.
To view the latest help, enter:
lrelease-pro -help
lrelease-pro options
| Option | Action |
|---|---|
-help | Display 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. |
-silent | Do not explain what is being done. |
-removeidentical | If the translated text is the same as the source text, exclude the message. |
-fail-on-unfinished | Generate an error if unfinished translations are found. |
-nounfinished | Do not include unfinished translations. |
-markuntranslated <prefix> | If a message has no real translation, use the source text prefixed with the given string instead. |
-version | Display 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
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.