summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorNiels Weber <niels.weber@digia.com>2015-01-29 12:29:09 +0100
committerNiels Weber <niels.weber@theqtcompany.com>2015-02-09 10:06:46 +0000
commit52ebff797da4a29f61459fd6d183d2e07498c591 (patch)
treeafe58065d5ad36faee01a9f5268c57fa006e9a3e /doc
parent04dcfb68cb7e2c3995f0b66b1bbd926b1864819b (diff)
Add a translation example
Add an example showing how the translation of components works. Also document this. Make translated license files work again. Task-number: QTIFW-469 Change-Id: I3c13ecc9941b09370d0713b19b2683b42454c43c Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/config/ifw.qdocconf2
-rw-r--r--doc/installerfw.qdoc17
2 files changed, 15 insertions, 4 deletions
diff --git a/doc/config/ifw.qdocconf b/doc/config/ifw.qdocconf
index d2ceafd73..f399ca872 100644
--- a/doc/config/ifw.qdocconf
+++ b/doc/config/ifw.qdocconf
@@ -18,7 +18,7 @@ exampledirs = $SRCDIR ../../examples
headers.fileextensions = "*.h"
sources.fileextensions = "*.qdoc *.qdocinc *.cpp"
-examples.fileextensions = "*.js *.qs *.txt *.xml *.ui"
+examples.fileextensions = "*.js *.qs *.txt *.xml *.ui *.ts"
examples.imageextensions = "*.png"
indexes += $QT_INSTALL_DOCS/qtcore/qtcore.index \
diff --git a/doc/installerfw.qdoc b/doc/installerfw.qdoc
index 14f07fa37..b209b03a4 100644
--- a/doc/installerfw.qdoc
+++ b/doc/installerfw.qdoc
@@ -453,7 +453,17 @@
interfaces, create QTranslator files that the installation system loads
along with the component. The installer loads the translation file that
matches the current system locale. For example, if the system locale is
- German, the de_de.qm file is loaded.
+ German, the de.qm file is loaded. In addition, a localized \c license_de.txt
+ is shown instead of the default \c license.txt if it is found.
+
+ Translations need to be added to the \c package.xml file to be activated for
+ a component:
+
+ \code
+ <Translations>
+ <Translation>de.qm</Translation>
+ </Translations>
+ \endcode
Use the \c {qsTr()} function for literal text within scripts. Additionally,
you can add the \c Component.prototype.retranslateUi method to the script.
@@ -462,10 +472,11 @@
The context being used for translation is the basename of the script file
when using \c qsTr or the class name of the UI file when translating a user
- interface.
+ interface. For example, if the script file is called \c installscript.qs, the
+ context will be installscript.
\note The translation system can also be used to customize the UI. Use e.g.
- an \c en_en.ts file to replace any text in the installer with a custom English
+ an \c en.ts file to replace any text in the installer with a custom English
version.
*/