forked from qt-creator/qt-creator
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:
BIN
doc/qtcreator/images/qtcreator-new-file-ts.webp
Normal file
BIN
doc/qtcreator/images/qtcreator-new-file-ts.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.7 KiB |
@@ -134,18 +134,30 @@
|
||||
|
||||
\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
|
||||
generate a translation source file (TS) for one language. You can add other
|
||||
languages later by editing the project file.
|
||||
generate a translation source file (TS) for one language. To add other
|
||||
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
|
||||
\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.
|
||||
For more information about Qt Linguist, see \l{Qt Linguist Manual}.
|
||||
|
||||
\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
|
||||
code and translations. The lrelease tool creates run-time
|
||||
translation files for use by the released application.
|
||||
@@ -156,22 +168,27 @@
|
||||
{Qt6::LinguistTools}.
|
||||
|
||||
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.
|
||||
|
||||
\section2 Synchronize TS files
|
||||
|
||||
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)}.
|
||||
|
||||
\section2 Generate QM files
|
||||
|
||||
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)}.
|
||||
|
||||
\sa {Use external tools}
|
||||
\if defined(qtcreator)
|
||||
\sa {Add translation files}
|
||||
\endif
|
||||
|
||||
\sa {Use external tools}, {Internationalization with Qt},
|
||||
{Qt Linguist Manual}
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
|
||||
\generatelist creator-how-to-projects-create
|
||||
|
||||
\section2 Create Files
|
||||
\section2 Add Files
|
||||
|
||||
\generatelist creator-how-to-projects-files
|
||||
|
||||
|
||||
@@ -43,8 +43,8 @@
|
||||
\li \uicontrol {Qt}
|
||||
\li Source and header files for item, table,
|
||||
or list models, \QD forms and a matching classes for Qt Widgets
|
||||
projects, Qt resource files, as well as QML and JavaScript files
|
||||
for Qt Quick projects.
|
||||
projects, Qt resource and translation files, as well as QML and
|
||||
JavaScript files for Qt Quick projects.
|
||||
\row
|
||||
\li \uicontrol {Compiler Explorer}
|
||||
\li Example setup for using Compiler Explorer to compile C++ or Python
|
||||
@@ -74,9 +74,7 @@
|
||||
\li Empty Nim source and script files.
|
||||
\endtable
|
||||
|
||||
\sa {Create compiler explorer sessions}, {Create C++ classes},
|
||||
{Create OpenGL fragment and vertex shaders}, {Create resource files},
|
||||
{Create UML-style models}, {Create vcpkg manifest files},
|
||||
\sa {Add Files}{How To: Add Files}, {Create UML-style models},
|
||||
{Use project wizards}
|
||||
*/
|
||||
|
||||
|
||||
@@ -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}
|
||||
*/
|
||||
@@ -157,7 +157,7 @@
|
||||
\list
|
||||
\li Create Projects
|
||||
\generatelist creator-how-to-projects-create
|
||||
\li Create Files
|
||||
\li Add Files
|
||||
\generatelist creator-how-to-projects-files
|
||||
\li Configure Projects
|
||||
\generatelist creator-how-to-projects-configure
|
||||
|
||||
Reference in New Issue
Block a user