3
3
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
4
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
<!-- /fasttmp/mkdist-qt-4.4.0-1209388211/qt-x11-opensource-src-4.4.0/doc/src/linguist-manual.qdoc -->
5
<!-- /fasttmp/mkdist-qt-4.4.1-1217326953/qt-all-opensource-src-4.4.1/doc/src/linguist-manual.qdoc -->
7
7
<title>Qt 4.4: Qt Linguist Manual: Release Manager</title>
8
8
<link rel="prev" href="linguist-manual.html" />
30
30
arrowpad_nl.ts</pre>
31
31
<p>Using a locale within the translation file name is useful for determining which language to load at runtime. This is explained in the <a href="linguist-programmers.html">Programmers</a> chapter.</p>
32
32
<p>An example of a complete <tt>.pro</tt> file with four translation source files:</p>
33
<pre> HEADERS = main-dlg.h \
35
SOURCES = main-dlg.cpp \
39
TRANSLATIONS = superapp_dk.ts \
43
CODECFORTR = ISO-8859-5</pre>
33
<pre> HEADERS = main-dlg.h \
35
SOURCES = main-dlg.cpp \
39
TRANSLATIONS = superapp_dk.ts \
43
CODECFORTR = ISO-8859-5</pre>
44
44
<p><a href="qtextcodec.html#setCodecForTr">QTextCodec::setCodecForTr</a>() makes it possible to choose a 8-bit encoding for literal strings that appear within <tt>tr()</tt> calls. This is useful for applications whose source language is, for example, Chinese or Japanese. If no encoding is set, <tt>tr()</tt> uses Latin1.</p>
45
45
<p>If you do use the <a href="qtextcodec.html#codecForTr">QTextCodec::codecForTr</a>() mechanism in your application, <i>Qt Linguist</i> needs you to set the <tt>CODECFORTR</tt> entry in the <tt>.pro</tt> file as well. For example:</p>
46
<pre> CODECFORTR = ISO-8859-5</pre>
46
<pre> CODECFORTR = ISO-8859-5</pre>
47
47
<p>Also, if your compiler uses a different encoding for its runtime system as for its source code and you want to use non-ASCII characters in string literals, you will need to set the <tt>CODECFORSRC</tt>. For example:</p>
48
<pre> CODECFORSRC = UTF-8</pre>
48
<pre> CODECFORSRC = UTF-8</pre>
49
49
<p>Microsoft Visual Studio 2005 .NET appears to be the only compiler for which this is necessary. However, if you want to write portable code, we recommend that you avoid non-ASCII characters in your source files. You can still specify non-ASCII characters portably using escape sequences, for example:</p>
50
<pre> label->setText(tr("F\374r \310lise"));</pre>
50
<pre> label->setText(tr("F\374r \310lise"));</pre>
51
51
<a name="lupdate"></a>
53
53
<p>Usage: <tt>lupdate myproject.pro</tt></p>
56
56
<p>Companies that hire in translators as required may prefer to run <a href="#lupdate">lupdate</a> only a few times in the application's life cycle, the first time might be just before the first test phase. This will provide the translator with a substantial single block of work and any bugs that the translator detects may easily be included with those found during the initial test phase. The second and any subsequent <a href="#lupdate">lupdate</a> runs would probably take place during the final beta phase.</p>
57
57
<p>The <tt>.ts</tt> file format is a simple human-readable XML format that can be used with version control systems if required. <tt>lupdate</tt> can also process Localization Interchange File Format (XLIFF) format files; file in this format typically have file names that end with the <tt>.xlf</tt> suffix.</p>
58
58
<p>Pass the <tt>-help</tt> option to <tt>lupdate</tt> to obtain the list of supported options:</p>
60
lupdate [options] [project-file]
61
lupdate [options] [source-file|path]... -ts ts-files
63
-help Display this information and exit.
65
Drop all obsolete strings.
66
-extensions <ext>[,<ext>]...
67
Process files with the given extensions only.
68
The extension list must be separated with commas, not with whitespace.
69
Default: 'ui,c,c++,cc,cpp,cxx,ch,h,h++,hh,hpp,hxx'.
71
Only include plural form messages.
73
Don't explain what is being done.
75
Display the version of lupdate and exit.</pre>
60
lupdate [options] [project-file]
61
lupdate [options] [source-file|path]... -ts ts-files
63
-help Display this information and exit.
65
Drop all obsolete strings.
66
-extensions <ext>[,<ext>]...
67
Process files with the given extensions only.
68
The extension list must be separated with commas, not with whitespace.
69
Default: 'ui,c,c++,cc,cpp,cxx,ch,h,h++,hh,hpp,hxx'.
71
Only include plural form messages.
73
Don't explain what is being done.
75
Display the version of lupdate and exit.</pre>
76
76
<p><i>Qt Linguist</i> is also able to import and export XLIFF files. See the <a href="linguist-translators.html">Translators</a> section for more information.</p>
77
77
<a name="lrelease"></a>
81
81
<p>This tool is run whenever a release of the application is to be made, from initial test version through to final release version. If the <tt>.qm</tt> files are not created, e.g. because an alpha release is required before any translation has been undertaken, the application will run perfectly well using the text the programmers placed in the source files. Once the <tt>.qm</tt> files are available the application will detect them and use them automatically.</p>
82
82
<p>Note that lrelease will only incorporate translations that are marked as "finished". Otherwise the original text will be used instead.</p>
83
83
<p>Pass the <tt>-help</tt> option to <tt>lrelease</tt> to obtain the list of supported options:</p>
85
lrelease [options] project-file
86
lrelease [options] ts-files [-qm qm-file]
88
-help Display this information and exit
90
Compress the .qm files
92
Do not include unfinished translations
94
If the translated text is the same as
95
the source text, do not include the message
97
Don't explain what is being done
99
Display the version of lrelease and exit</pre>
85
lrelease [options] project-file
86
lrelease [options] ts-files [-qm qm-file]
88
-help Display this information and exit
90
Compress the .qm files
92
Do not include unfinished translations
94
If the translated text is the same as
95
the source text, do not include the message
97
Don't explain what is being done
99
Display the version of lrelease and exit</pre>
100
100
<a name="missing-translations"></a>
101
101
<h2>Missing Translations</h2>
102
102
<p>Both <a href="#lupdate">lupdate</a> and <a href="#lrelease">lrelease</a> may be used with <tt>.ts</tt> translation source files which are incomplete. Missing translations will be replaced with the native language phrases at runtime.</p>
109
109
<table width="100%" cellspacing="0" border="0"><tr class="address">
110
110
<td width="30%">Copyright © 2008 <a href="trolltech.html">Trolltech</a></td>
111
111
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
112
<td width="30%" align="right"><div align="right">Qt 4.4.0</div></td>
112
<td width="30%" align="right"><div align="right">Qt 4.4.1</div></td>
113
113
</tr></table></div></address></body>