~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to doc/html/linguist-manager.html

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2008-08-01 11:30:30 UTC
  • mto: (15.1.1 lenny) (1.3.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 55.
  • Revision ID: james.westby@ubuntu.com-20080801113030-c33y1z0l21t6cj5r
Tags: upstream-4.4.1
ImportĀ upstreamĀ versionĀ 4.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
<!DOCTYPE html
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 -->
6
6
<head>
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 \
34
 
                           options-dlg.h
35
 
         SOURCES         = main-dlg.cpp \
36
 
                           options-dlg.cpp \
37
 
                           main.cpp
38
 
         FORMS           = search-dlg.ui
39
 
         TRANSLATIONS    = superapp_dk.ts \
40
 
                           superapp_fi.ts \
41
 
                           superapp_no.ts \
42
 
                           superapp_se.ts
43
 
         CODECFORTR      = ISO-8859-5</pre>
 
33
<pre> HEADERS         = main-dlg.h \
 
34
                   options-dlg.h
 
35
 SOURCES         = main-dlg.cpp \
 
36
                   options-dlg.cpp \
 
37
                   main.cpp
 
38
 FORMS           = search-dlg.ui
 
39
 TRANSLATIONS    = superapp_dk.ts \
 
40
                   superapp_fi.ts \
 
41
                   superapp_no.ts \
 
42
                   superapp_se.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-&gt;setText(tr(&quot;F\374r \310lise&quot;));</pre>
 
50
<pre> label-&gt;setText(tr(&quot;F\374r \310lise&quot;));</pre>
51
51
<a name="lupdate"></a>
52
52
<h2>lupdate</h2>
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>
59
 
<pre>         Usage:
60
 
             lupdate [options] [project-file]
61
 
             lupdate [options] [source-file|path]... -ts ts-files
62
 
         Options:
63
 
             -help  Display this information and exit.
64
 
             -noobsolete
65
 
                    Drop all obsolete strings.
66
 
             -extensions &lt;ext&gt;[,&lt;ext&gt;]...
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'.
70
 
             -pluralonly
71
 
                    Only include plural form messages.
72
 
             -silent
73
 
                    Don't explain what is being done.
74
 
             -version
75
 
                    Display the version of lupdate and exit.</pre>
 
59
<pre> Usage:
 
60
     lupdate [options] [project-file]
 
61
     lupdate [options] [source-file|path]... -ts ts-files
 
62
 Options:
 
63
     -help  Display this information and exit.
 
64
     -noobsolete
 
65
            Drop all obsolete strings.
 
66
     -extensions &lt;ext&gt;[,&lt;ext&gt;]...
 
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'.
 
70
     -pluralonly
 
71
            Only include plural form messages.
 
72
     -silent
 
73
            Don't explain what is being done.
 
74
     -version
 
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>
78
78
<h2>lrelease</h2>
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&#x2e; 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 &quot;finished&quot;. 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>
84
 
<pre>         Usage:
85
 
             lrelease [options] project-file
86
 
             lrelease [options] ts-files [-qm qm-file]
87
 
         Options:
88
 
             -help  Display this information and exit
89
 
             -compress
90
 
                    Compress the .qm files
91
 
             -nounfinished
92
 
                    Do not include unfinished translations
93
 
             -removeidentical
94
 
                    If the translated text is the same as
95
 
                    the source text, do not include the message
96
 
             -silent
97
 
                    Don't explain what is being done
98
 
             -version
99
 
                    Display the version of lrelease and exit</pre>
 
84
<pre> Usage:
 
85
     lrelease [options] project-file
 
86
     lrelease [options] ts-files [-qm qm-file]
 
87
 Options:
 
88
     -help  Display this information and exit
 
89
     -compress
 
90
            Compress the .qm files
 
91
     -nounfinished
 
92
            Do not include unfinished translations
 
93
     -removeidentical
 
94
            If the translated text is the same as
 
95
            the source text, do not include the message
 
96
     -silent
 
97
            Don't explain what is being done
 
98
     -version
 
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 &copy; 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>
114
114
</html>