Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qt_deploy_translations.qdoc
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5\page qt-deploy-translations.html
6\ingroup cmake-commands-qtcore
7
8\title qt_deploy_translations
9\keyword qt6_deploy_translations
10
11\summary {Deploy Qt translations needed by an executable.}
12
13\include cmake-find-package-core.qdocinc
14
15Unlike most other CMake commands provided by Qt, \c{qt_deploy_translations()}
16can only be called from a deployment script. It cannot be called directly by the
17project during the configure stage.
18
19\cmakecommandsince 6.5
20\preliminarycmakecommand
21\note This command does not usually need to be called directly. It is used
22 internally by other higher level commands, but projects wishing to
23 implement more customized deployment logic may find it useful.
24
25\section1 Synopsis
26
27\badcode
28qt_deploy_translations(
29 [CATALOGS catalogs]
30 [LOCALES locales]
31 [LCONVERT lconvert_executable]
32 [VERBOSE]
33)
34\endcode
35
36\section1 Description
37
38When installing an application, it may be desirable to also install the
39translations that belong to the used Qt modules. The \c qt_deploy_translations
40command collects the necessary \c{.qm} file from the Qt installation and
41compiles them into one \c{qt_${language}.qm} file per language. The \c{.qm}
42files are installed into \c{QT_DEPLOY_TRANSLATIONS_DIR}.
43
44\section1 Arguments
45
46The \c LOCALES argument specifies for which locales translations should be
47deployed. This is a list of language/region combinations as described in
48\l{Changing the Target Locale}{Qt Linguist's manual for translators}. Examples
49for valid locales are: \c{de}, \c{pl}, or \c{pt_BR}.
50
51If \c LOCALES is omitted, then all available locales are deployed.
52
53The \c CATALOGS argument specifies a list of \l{Available
54Catalogs}{translation catalogs} to be deployed. If this argument is
55omitted, then all catalogs are deployed that belong to any Qt module
56that is used in the project via \c{find_package}.
57
58The \c LCONVERT argument specifies the \c lconvert executable that is used to
59combine the catalogs. By default, the Qt installation's \c lconvert is used.
60
61For debugging purposes, the \c VERBOSE argument can be set to turn on diagnostic
62messages.
63
64\sa QT_DEPLOY_TRANSLATIONS_DIR
65
66\section1 Example
67
68The following example deploys Danish and German translations of the Qt
69libraries.
70
71\badcode
72qt_deploy_translations(
73 LOCALES da de
74)
75\endcode
76*/