Doc: Describe Qt Translation File wizard

Task-number: QTCREATORBUG-30209
Change-Id: I9a5d04d59e836cb08dd3eafd9d4ea22106aea4a0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Leena Miettinen
2024-02-13 18:04:27 +01:00
parent 83eaeda954
commit 5639c141ff
6 changed files with 61 additions and 16 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@@ -134,18 +134,30 @@
\title Use Qt Linguist \title Use Qt Linguist
Most of the text to translate in an application consists of either single
words or short phrases. These typically appear as window titles, menu items,
tooltips, and labels to buttons, checkboxes, and radio buttons.
You mark the phrases as translatable in the QML and C++ source code. Qt
localization tools provide context information for each of the phrases to
help the translator understand their meaning. You can add comments to the
phrases.
Translation files contain all the user-visible text and keyboard shortcuts
in an application and translations of that text.
When you \l{Creating Projects}{create a new project}, you can automatically When you \l{Creating Projects}{create a new project}, you can automatically
generate a translation source file (TS) for one language. You can add other generate a translation source file (TS) for one language. To add other
languages later by editing the project file. languages, edit the project file or go to \uicontrol File >
\uicontrol {New File}.
To open TS files in Qt Linguist, right-click a TS file in the To open TS files in Qt Linguist, right-click a TS file in the
\uicontrol Projects or \uicontrol {File System} view and select \uicontrol Projects or \uicontrol {File System} view and go to
\uicontrol {Open With} > \uicontrol {Qt Linguist} in the context menu. \uicontrol {Open With} > \uicontrol {Qt Linguist} in the context menu.
For more information about Qt Linguist, see \l{Qt Linguist Manual}.
\section1 Use lupdate and lrelease \section1 Use lupdate and lrelease
You can use the Qt Linguist release manager tools, lupdate and lrelease, Use the Qt Linguist release manager tools, lupdate and lrelease,
directly from \QC. The lupdate tool synchronizes source directly from \QC. The lupdate tool synchronizes source
code and translations. The lrelease tool creates run-time code and translations. The lrelease tool creates run-time
translation files for use by the released application. translation files for use by the released application.
@@ -156,22 +168,27 @@
{Qt6::LinguistTools}. {Qt6::LinguistTools}.
By default, the project .pro file is passed to the tools as an argument. To By default, the project .pro file is passed to the tools as an argument. To
specify other command-line arguments for the tools, select \uicontrol Tools > specify other command-line arguments for the tools, go to \uicontrol Tools >
\uicontrol External > \uicontrol Configure. \uicontrol External > \uicontrol Configure.
\section2 Synchronize TS files \section2 Synchronize TS files
To synchronize TS files from a translator with the To synchronize TS files from a translator with the
application code, select \uicontrol Tools > \uicontrol External > application code, go to \uicontrol Tools > \uicontrol External >
\uicontrol Linguist > \uicontrol {Update Translations (lupdate)}. \uicontrol Linguist > \uicontrol {Update Translations (lupdate)}.
\section2 Generate QM files \section2 Generate QM files
To generate from the TS files Qt message (QM) files that can be used by an To generate from the TS files Qt message (QM) files that can be used by an
application, select \uicontrol Tools > \uicontrol External > application, go to \uicontrol Tools > \uicontrol External >
\uicontrol Linguist > \uicontrol {Release Translations (lrelease)}. \uicontrol Linguist > \uicontrol {Release Translations (lrelease)}.
\sa {Use external tools} \if defined(qtcreator)
\sa {Add translation files}
\endif
\sa {Use external tools}, {Internationalization with Qt},
{Qt Linguist Manual}
*/ */
/*! /*!

View File

@@ -77,7 +77,7 @@
\generatelist creator-how-to-projects-create \generatelist creator-how-to-projects-create
\section2 Create Files \section2 Add Files
\generatelist creator-how-to-projects-files \generatelist creator-how-to-projects-files

View File

@@ -43,8 +43,8 @@
\li \uicontrol {Qt} \li \uicontrol {Qt}
\li Source and header files for item, table, \li Source and header files for item, table,
or list models, \QD forms and a matching classes for Qt Widgets or list models, \QD forms and a matching classes for Qt Widgets
projects, Qt resource files, as well as QML and JavaScript files projects, Qt resource and translation files, as well as QML and
for Qt Quick projects. JavaScript files for Qt Quick projects.
\row \row
\li \uicontrol {Compiler Explorer} \li \uicontrol {Compiler Explorer}
\li Example setup for using Compiler Explorer to compile C++ or Python \li Example setup for using Compiler Explorer to compile C++ or Python
@@ -74,9 +74,7 @@
\li Empty Nim source and script files. \li Empty Nim source and script files.
\endtable \endtable
\sa {Create compiler explorer sessions}, {Create C++ classes}, \sa {Add Files}{How To: Add Files}, {Create UML-style models},
{Create OpenGL fragment and vertex shaders}, {Create resource files},
{Create UML-style models}, {Create vcpkg manifest files},
{Use project wizards} {Use project wizards}
*/ */

View File

@@ -0,0 +1,30 @@
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\page creator-how-to-add-ts-files.html
\previouspage creator-how-tos.html
\ingroup creator-how-to-projects-files
\title Add translation files
When you \l{Creating Projects}{create a new project}, you can automatically
generate a translation source file (TS) for one language. To add other
languages later, use a file wizard.
To create a translation source (TS) file for a language:
\list 1
\li Go to \uicontrol File > \uicontrol {New File}.
\li Select \uicontrol Qt > \uicontrol {Qt Translation File} >
\uicontrol Choose.
\li In \uicontrol Language, select a language and territory (\e locale).
\image qtcreator-new-file-ts.webp {Select language for a TS file}
\endlist
You can see the file name in \uicontrol {Translation file}.
\sa {Create files}, {Use project wizards}, {Use Qt Linguist},
{Internationalization with Qt}, {Qt Linguist Manual}
*/

View File

@@ -157,7 +157,7 @@
\list \list
\li Create Projects \li Create Projects
\generatelist creator-how-to-projects-create \generatelist creator-how-to-projects-create
\li Create Files \li Add Files
\generatelist creator-how-to-projects-files \generatelist creator-how-to-projects-files
\li Configure Projects \li Configure Projects
\generatelist creator-how-to-projects-configure \generatelist creator-how-to-projects-configure