lrelease command line tool produces QM files out of TS files. The QM file format is a compact binary format that the localized application uses. It provides extremely fast lookup for translations.
When building with qmake, specify the files to process at the command line or in a .pro file.
When building with CMake, use CMake commands to add targets that create or update TS files and transform them into QM files. The
lrelease tool is run with the options you pass to the commands when you build the target.
lrelease whenever you want to release the application, from the initial test version through to the final release version. The application does not need QM files to run, but if they are available, the application detects them and uses them automatically.
lrelease tool only incorporates translations that you mark as finished. Otherwise, it uses the original text instead.
lrelease [options] -project project-file lrelease [options] ts-files [-qm qm-file]
optionsmeans one or several lrelease options.
project-fileis the project configuration file.
ts-filesare the TS files to use as input for the QM files.
qm-fileis the name of the QM file to generate.
Note: Passing .pro files to
lrelease is deprecated. Use the
lrelease-pro tool or the
lrelease.prf feature when using qmake.
To view the latest help, enter:
|Display up-to-date help information and exit.|
|Use IDs instead of source strings for message keying.|
|Compress the QM files.|
|Do not include unfinished translations.|
|If the translated text is the same as the source text, exclude the message.|
|If a message has no real translation, use the source text prefixed with the given string instead.|
|Name of a file containing the project's description in JSON format. You can use the |
|Do not explain what is being done.|
|Display the version of |
When building with CMake, use CMake commands to add translations on targets to the CMakeLists.txt file, and then build the targets.
Select one of the following options:
- Use qt_add_translations on a target, such as app. This calls qt_add_lupdate and qt_add_lrelease.
qt_add_lreleaseon a target.
Build a target (for example,
app_lrelease) to update the .qm files for it. To update the .qm files for all targets, build the target
lrelease without specifying a project file:
lrelease.exe main_en.ts languages\main_fr.ts
© 2023 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.