summaryrefslogtreecommitdiffstats
path: root/src/corelib/doc/src/cmake/qt_deploy_translations.qdoc
blob: 43ff23a35a10ffb077b0595c607e5acfc444826d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

/*!
\page qt-deploy-translations.html
\ingroup cmake-commands-qtcore

\title qt_deploy_translations
\keyword qt6_deploy_translations

\summary {Deploy Qt translations needed by an executable.}

\include cmake-find-package-core.qdocinc

Unlike most other CMake commands provided by Qt, \c{qt_deploy_translations()}
can only be called from a deployment script. It cannot be called directly by the
project during the configure stage.

\cmakecommandsince 6.5
\preliminarycmakecommand
\note This command does not usually need to be called directly. It is used
      internally by other higher level commands, but projects wishing to
      implement more customized deployment logic may find it useful.

\section1 Synopsis

\badcode
qt_deploy_translations(
    [CATALOGS catalogs]
    [LOCALES locales]
    [LCONVERT lconvert_executable]
    [VERBOSE]
)
\endcode

\section1 Description

When installing an application, it may be desirable to also install the
translations that belong to the used Qt modules. The \c qt_deploy_translations
command collects the necessary \c{.qm} file from the Qt installation and
compiles them into one \c{qt_${language}.qm} file per language. The \c{.qm}
files are installed into \c{QT_DEPLOY_TRANSLATIONS_DIR}.

\section1 Arguments

The \c LOCALES argument specifies for which locales translations should be
deployed. This is a list of language/region combinations as described in
\l{Changing the Target Locale}{Qt Linguist's manual for translators}. Examples
for valid locales are: \c{de}, \c{pl}, or \c{pt_BR}.

If \c LOCALES is omitted, then all available locales are deployed.

The \c CATALOGS argument specifies a list of \l{Available
Catalogs}{translation catalogs} to be deployed. If this argument is
omitted, then all catalogs are deployed that belong to any Qt module
that is used in the project via \c{find_package}.

The \c LCONVERT argument specifies the \c lconvert executable that is used to
combine the catalogs. By default, the Qt installation's \c lconvert is used.

For debugging purposes, the \c VERBOSE argument can be set to turn on diagnostic
messages.

\sa QT_DEPLOY_TRANSLATIONS_DIR

\section1 Example

The following example deploys Danish and German translations of the Qt
libraries.

\badcode
qt_deploy_translations(
    LOCALES da de
)
\endcode
*/