Details
-
User Story
-
Resolution: Done
-
P2: Important
-
None
-
None
Description
Apparently it's not simple to handle translations with CMake.
The translation binary actually parses .pro files.
So we probably have to come up with a new way how things should be done.
EDIT:
So afaik, the plan would be to use CMake public API for both examples and the modules themselves.
Work is being done to teach lupdate to use a compilation database for figuring out which files need to be processed (from which files to extract strings).
Until that is done it is possible to give lupdate a path, that will glob through all files under that path and extract strings.
The workflow would then be to run lupdate to create .ts file with strings, and then run lrelease to create the binary blobs. Afaik the macros already exist in Qt5 and should be ported to Qt6 and used, docs here https://doc-snapshots.qt.io/qt5-dev/cmake-command-reference.html#qt5-linguisttools .
I guess what would be useful to implement, is targets like translations_Core, which would run lupdate and lrelease on the specified target.
qmake does its magic in qttranslations/translations/translations.pro
and once qmake is executed there, you have targets like make, make ts-de, make ts-qtdeclarative-de
Not sure if we want to keep the Makefile targets per repo or per cmake target.
Some partially outdated info at https://wiki.qt.io/Qt_Localization
https://wiki.qt.io/Automating_generation_of_qm_files
Attachments
Issue Links
- relates to
-
QTBUG-76410 CMake: Introduce qt_update_translation function
- Closed