Details
-
Task
-
Resolution: Done
-
P2: Important
-
None
-
22c5a32c096997266d627677cf8e281c186304d7 (qt/qttools/dev)
Description
- Replace qt5_create_translation(...) by a new CMake command that solely updates .ts files. The new command should support both setting sources and include directories explicitly, as well as deduce it from a target:
Explicit mode
qt5_update_translation(ts_file1 [ts_file2 ...] SOURCES file1...] [INCLUDE_DIRECTORIES include1 ...] [OPTIONS ...] }
Options:
INCLUDE_DIRECTORIES - sets include directories to be passed to lupdate. If not set, the default is INCLUDE_DIRECTORIES of the current directory.
Example use
qt5_update_translation(app_de.ts SOURCES main.cpp)
qt5_update_translation(app_en.ts SOURCES main.cpp OPTIONS -pluralsonly)
add_custom_target(update_translations DEPENDS app_de.ts app_en.ts)
add_dependencies(update_translations )
Target mode
qt5_update_translation(ts_file1 [ts_file2 ...]
TARGET myapp
[OPTIONS ...]
TODO: How to handle runtime files like .qml?
Attachments
Issue Links
- is duplicated by
-
QTBUG-91250 qt5_create_translation
- Closed
- relates to
-
QTBUG-75945 Add translations support
- Closed
-
QTBUG-80848 Handle translation exclusion info
- Closed
-
QTBUG-96549 make clean removes ts file when using qt5_create_translation()
- Closed
- replaces
-
QTBUG-41736 CMake + Qt5LinguistToolsMacros.cmake: QT5_CREATE_TRANSLATION clean deletes .ts files instead of updating
- Closed