Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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\note This command does not usually need to be called directly. It is used
21 internally by other higher level commands, but projects wishing to
22 implement more customized deployment logic may find it useful.
23
24\section1 Synopsis
25
26\badcode
27qt_deploy_translations(
28 [CATALOGS catalogs]
29 [LOCALES locales]
30 [LCONVERT lconvert_executable]
31 [VERBOSE]
32)
33\endcode
34
35\section1 Description
36
37When installing an application, it may be desirable to also install the
38translations that belong to the used Qt modules. The \c qt_deploy_translations
39command collects the necessary \c{.qm} file from the Qt installation and
40compiles them into one \c{qt_${language}.qm} file per language. The \c{.qm}
41files are installed into \c{QT_DEPLOY_TRANSLATIONS_DIR}.
42
43\section1 Arguments
44
45The \c LOCALES argument specifies for which locales translations should be
46deployed. This is a list of language/region combinations as described in
47\l{Changing the Target Locale}{Qt Linguist's manual for translators}. Examples
48for valid locales are: \c{de}, \c{pl}, or \c{pt_BR}.
49
50If \c LOCALES is omitted, then all available locales are deployed.
51
52The \c CATALOGS argument specifies a list of \l{Available
53Catalogs}{translation catalogs} to be deployed. If this argument is
54omitted, then all catalogs are deployed that belong to any Qt module
55that is used in the project via \c{find_package}.
56
57The \c LCONVERT argument specifies the \c lconvert executable that is used to
58combine the catalogs. By default, the Qt installation's \c lconvert is used.
59
60For debugging purposes, the \c VERBOSE argument can be set to turn on diagnostic
61messages.
62
63\sa QT_DEPLOY_TRANSLATIONS_DIR
64
65\section1 Example
66
67The following example deploys Danish and German translations of the Qt
68libraries.
69
70\badcode
71qt_deploy_translations(
72 LOCALES da de
73)
74\endcode
75*/