diff --git a/doc/qtcreator/images/qtcreator-new-file-ts.webp b/doc/qtcreator/images/qtcreator-new-file-ts.webp new file mode 100644 index 00000000000..3ad21a25d91 Binary files /dev/null and b/doc/qtcreator/images/qtcreator-new-file-ts.webp differ diff --git a/doc/qtcreator/src/howto/creator-external-tools.qdoc b/doc/qtcreator/src/howto/creator-external-tools.qdoc index 3f29dfc57bf..dda7eeb62ae 100644 --- a/doc/qtcreator/src/howto/creator-external-tools.qdoc +++ b/doc/qtcreator/src/howto/creator-external-tools.qdoc @@ -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} */ /*! diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc index 6c3fc7fd84e..0643c3a1525 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc @@ -77,7 +77,7 @@ \generatelist creator-how-to-projects-create - \section2 Create Files + \section2 Add Files \generatelist creator-how-to-projects-files diff --git a/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc b/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc index 6b953d4401d..d03263d4625 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc @@ -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} */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-how-to-create-ts-files.qdoc b/doc/qtcreator/src/projects/creator-only/creator-how-to-create-ts-files.qdoc new file mode 100644 index 00000000000..cb4471aeb5d --- /dev/null +++ b/doc/qtcreator/src/projects/creator-only/creator-how-to-create-ts-files.qdoc @@ -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} +*/ diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index 5f2daf2737f..ec8408795fc 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -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