diff options
Diffstat (limited to 'doc/src/examples/qml-examples.qdoc')
-rw-r--r-- | doc/src/examples/qml-examples.qdoc | 41 |
1 files changed, 36 insertions, 5 deletions
diff --git a/doc/src/examples/qml-examples.qdoc b/doc/src/examples/qml-examples.qdoc index 745baa3..ca24c66 100644 --- a/doc/src/examples/qml-examples.qdoc +++ b/doc/src/examples/qml-examples.qdoc @@ -7,11 +7,11 @@ ** This file is part of the documentation of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:FDL$ -** Commercial Usage -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in a -** written agreement between you and Nokia. +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. ** ** GNU Free Documentation License ** Alternatively, this file may be used under the terms of the GNU Free @@ -236,6 +236,37 @@ This example shows how to enable text translation in QML. \image qml-i18n-example.png + + \section1 Introduction + + The QML runtime automatically loads a translation from the i18n subdirectory + of the root QML file, based on the system language. The translations are + held in QM files that must be generated from TS files. + + \section1 Updating Translations + + The \c{.ts} files are created and updated by running: + + \code + lupdate i18n.qml -ts i18n/base.ts + \endcode + + If no translation file exists, one will be created. If a file already exists, + it will be updated to contain the latest strings from the QML file. + + Translations for new languages are created by copying \c{i18n/base.ts} to + \c{i18n/qml_<lang>.ts} The TS files can then be edited with + \l{Qt Linguist Manual}{Qt Linguist}: + + \code + linguist i18n/qml_fr.ts + \endcode + + The run-time translation files are then generated by running: + + \code + lrelease i18n/*.ts + \endcode */ /*! |