summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/src/internationalization/linguist-manual.qdoc103
1 files changed, 55 insertions, 48 deletions
diff --git a/doc/src/internationalization/linguist-manual.qdoc b/doc/src/internationalization/linguist-manual.qdoc
index 1f413f9..f4cce3a 100644
--- a/doc/src/internationalization/linguist-manual.qdoc
+++ b/doc/src/internationalization/linguist-manual.qdoc
@@ -46,10 +46,10 @@
at the person with overall responsibility for the release of the
application. They will typically coordinate the work of the
software engineers and the translator. The chapter describes the
- use of two tools. The \l{lupdate} tool is used to synchronize
- source code and translations. The \l{lrelease} tool is used to
- create run-time translation files for use by the released
- application.
+ use of two tools. The \l{linguist-manager.html#lupdate}{lupdate}
+ tool is used to synchronize source code and translations. The
+ \l{linguist-manager.html#lrelease}{lrelease} tool is used to create
+ run-time translation files for use by the released application.
The \l{linguist-translators.html}{Translators} chapter is for
translators. It describes the use of the \QL tool.
@@ -149,20 +149,16 @@
\previouspage Qt Linguist Manual
\nextpage Qt Linguist Manual: Translators
- \keyword lupdate
- \keyword lrelease
-
Two tools are provided for the release manager, \l lupdate and \l
lrelease. These tools can process \l qmake project files, or operate
directly on the file system.
\section1 Qt Project Files
- The easiest method to use \l{#lupdate} {lupdate} and \l{#lrelease}
- {lrelease} is by specifying a \c .pro Qt project file. There must
- be an entry in the \c TRANSLATIONS section of the project file for
- each language that is additional to the native language. A typical
- entry looks like this:
+ The easiest method to use \l lupdate and \l lrelease is by specifing
+ a \c .pro Qt project file. There must be an entry in the \c TRANSLATIONS
+ section of the project file for each language that is additional to
+ the native language. A typical entry looks like this:
\snippet examples/linguist/arrowpad/arrowpad.pro 1
@@ -203,7 +199,6 @@
\snippet doc/src/snippets/code/doc_src_linguist-manual.qdoc 3
- \target lupdate manual
\section1 lupdate
Usage: \c {lupdate myproject.pro}
@@ -271,7 +266,7 @@
are available the application will detect them and use them
automatically.
- Note that lrelease will only incorporate translations that are
+ Note that \l lrelease will only incorporate translations that are
marked as "finished". Otherwise the original text will be used
instead.
@@ -606,8 +601,8 @@
If the source context shows the wrong source line, it probably
means the translation file is out of sync with the source files.
- To re-sync the translation file with the source files, see the
- \l{lupdate manual} {lupdate manual}.
+ To re-sync the translation file with the source files, see the
+ \l{linguist-manager.html#lupdate}{lupdate} manual.
The Sources and Forms window is a dockable window. If it has been
closed, it can be made visible again by pressing the \e{Sources
@@ -947,8 +942,8 @@
\list
\o TS \e {translation source files} \BR are human-readable XML
files containing source phrases and their translations. These files are
- usually created and updated by \l lupdate and are specific to an
- application.
+ usually created and updated by \l{linguist-manager.html#lupdate}{lupdate}
+ and are specific to an application.
\o \c .xlf \e {XLIFF files} \BR are human-readable XML files that adhere
to the international XML Localization Interchange File Format. \QL
can be used to edit XLIFF files generated by other programs. However, for
@@ -957,7 +952,8 @@
are not supported.
\o QM \e {Qt message files} \BR are binary files that contain
translations used by an application at run-time. These files are
- generated by \l lrelease, but can also be generated by \QL.
+ generated by \l{linguist-manager.html#lrelease}{lrelease}, but can also
+ be generated by \QL.
\o \c .qph \e {Qt phrase book files} \BR are human-readable XML
files containing standard phrases and their translations. These files
are created and updated by \QL and may be used by any
@@ -982,13 +978,15 @@
name, format and/or put in a different location.
\o \gui {Release} \BR create a Qt message QM file with the same base
name as the current translation source file. The release manager's
- command line tool \l lrelease performs the same function on
- \e all of an application's translation source files.
+ command line tool \l{linguist-manager.html#lrelease}{lrelease}
+ performs the same function on \e all of an application's translation
+ source files.
\o \gui {Release As...} \BR pops up a save as file dialog. The
filename entered will be a Qt message QM file of the translation
based on the current translation source file. The release manager's
- command line tool \l lrelease performs the same function on
- \e all of an application's translation source files.
+ command line tool \l{linguist-manager.html#lrelease}{lrelease}
+ performs the same function on \e all of an application's translation
+ source files.
\o \gui {Print... Ctrl+P} \BR pops up a print dialog. If you click
OK the translation source and the translations will be printed.
\o \gui {Exit Ctrl+Q} \BR closes \QL.
@@ -1262,28 +1260,32 @@
Translation files are created as follows:
\list 1
- \o Run \l lupdate initially to generate the first set of TS
- translation source files with all the user-visible text but no
- translations.
+ \o Run \l {linguist-manager.html#lupdate}{lupdate} initially to
+ generate the first set of TS translation source files with all the
+ user-visible text but no translations.
\o The TS files are given to the translator who adds translations
using \QL. \QL takes care of any changed
or deleted source text.
- \o Run \l lupdate to incorporate any new text added to the
- application. \l lupdate synchronizes the user-visible text from the
- application with the translations; it does not destroy any data.
+ \o Run \l{linguist-manager.html#lupdate}{lupdate} to incorporate any new
+ text added to the application. \l{linguist-manager.html#lupdate}{lupdate}
+ synchronizes the user-visible text from the application with the
+ translations; it does not destroy any data.
\o Steps 2 and 3 are repeated as often as necessary.
- \o When a release of the application is needed \l lrelease is run to
+ \o When a release of the application is needed
+ \l{linguist-manager.html#lrelease}{lrelease} is run to
read the TS files and produce the QM files used by the
application at runtime.
\endlist
- For \l lupdate to work successfully, it must know which translation
- files to produce. The files are simply listed in the application's \c
+ For \l{linguist-manager.html#lupdate}{lupdate} to work successfully,
+ it must know which translation files to produce. The files are simply
+ listed in the application's \c
.pro Qt project file, for example:
\snippet examples/linguist/arrowpad/arrowpad.pro 1
- If your sources contain genuine non-Latin1 strings, \l lupdate needs
+ If your sources contain genuine non-Latin1 strings,
+ \l{linguist-manager.html#lupdate}{lupdate} needs
to be told about it in the \c .pro file by using, for example,
the following line:
@@ -1291,7 +1293,8 @@
CODECFORTR = UTF-8
\endcode
- See the \l lupdate and \l lrelease sections.
+ See the \l{linguist-manager.html#lupdate}{lupdate} and
+ \l{linguist-manager.html#lrelease}{lrelease} sections.
\section2 Loading Translations
@@ -1354,14 +1357,14 @@
\section2 Distinguishing Between Identical Translatable Strings
- The \l lupdate program automatically provides a \e context for every
- source text. This context is the class name of the class that contains
- the \c tr() call. This is sufficient in the vast majority of cases.
- Sometimes however, the translator will need further information to
- uniquely identify a source text; for example, a dialog that contained
- two separate frames, each of which contained an "Enabled" option would
- need each identified because in some languages the translation would
- differ between the two. This is easily achieved using the
+ The \l{linguist-manager.html#lupdate}{lupdate} program automatically
+ provides a \e context for every source text. This context is the class
+ name of the class that contains the \c tr() call. This is sufficient in
+ the vast majority of cases. Sometimes however, the translator will need
+ further information to uniquely identify a source text; for example,
+ a dialog that contained two separate frames, each of which contained an
+ "Enabled" option would need each identified because in some languages the
+ translation would differ between the two. This is easily achieved using the
two argument form of the \c tr() call, e.g.
\snippet doc/src/snippets/code/doc_src_linguist-manual.qdoc 10
@@ -1410,7 +1413,8 @@
replaced with count's value (e.g., "6 item(s) replaced").
To handle plural forms in the native language, you need to load a
- translation file for this language, too. \l lupdate has the
+ translation file for this language, too.
+ \l{linguist-manager.html#lupdate}{lupdate} has the
\c -pluralonly command line option, which allows the creation of
TS files containing only entries with plural forms.
@@ -1421,8 +1425,9 @@
\section2 Coping With C++ Namespaces
C++ namespaces and the \c {using namespace} statement can confuse
- \l lupdate. It will interpret \c MyClass::tr() as meaning just
- that, not as \c MyNamespace::MyClass::tr(), even if \c MyClass is
+ \l{linguist-manager.html#lupdate}{lupdate}. It will interpret
+ \c MyClass::tr() as meaning just that, not as
+ \c MyNamespace::MyClass::tr(), even if \c MyClass is
defined in the \c MyNamespace namespace. Runtime translation of
these strings will fail because of that.
@@ -1449,7 +1454,8 @@
If you need to have translatable text completely outside a function,
there are two macros to help: QT_TR_NOOP() and QT_TRANSLATE_NOOP().
- These macros merely mark the text for extraction by \l{lupdate}.
+ These macros merely mark the text for extraction by
+ \l{linguist-manager.html#lupdate}{lupdate}.
The macros expand to just the text (without the context).
Example of QT_TR_NOOP():
@@ -1484,8 +1490,9 @@
applications for translation.
At the beginning of a project add the translation source files to be
- used to the project file and add calls to \l lupdate and \l lrelease to
- the makefile.
+ used to the project file and add calls to
+ \l{linguist-manager.html#lupdate}{lupdate} and
+ \l{linguist-manager.html#lrelease}{lrelease} to the makefile.
During the project all the programmer must do is wrap any user-visible
text in \c tr() calls. They should also use the two argument form for