W3cubDocs

/Qt 6.9

QT_EXCLUDE_FROM_TRANSLATION

This property was introduced in Qt 6.7.

Set this target property to ON to exclude it from translation. The command qt_collect_translation_source_targets will skip such targets.

To exclude all targets under a subdirectory, use the directory property QT_EXCLUDE_FROM_TRANSLATION.

Examples

In the following example, translatable strings will not be extracted from the mytest target.

qt_add_executable(myapp main.cpp)
qt_add_executable(mytest test.cpp)
set_property(TARGET mytest PROPERTY QT_EXCLUDE_FROM_TRANSLATION ON)
qt_add_translations(myapp)

See also QT_EXCLUDE_SOURCES_FROM_TRANSLATION.

© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-6.9/cmake-target-property-qt-exclude-from-translation.html