<!-- index Release Manager --><p>Two tools are provided for the release manager, <ahref="linguist-manual-2.html#2">lupdate</a> and <ahref="linguist-manual-2.html#3">lrelease</a>. These tools depend on <em>qmake</em> project files. You don't have to use <em>qmake</em>, though.</p>
<!-- index .pro Files --><!-- index Project Files --><!-- index qmake!Project Files --><p><ahref="linguist-manual-2.html#2">lupdate</a> and <ahref="linguist-manual-2.html#3">lrelease</a> depend on information in the application's <tt>.pro</tt> TQt project file. There must be an entry in the <tt>TRANSLATIONS</tt> section of the project file for each language that is additional to the native language. A typical entry looks like this:</p>
<!-- index TRANSLATIONS!in Project Files --><pre> TRANSLATIONS = tt2_fr.ts \
tt2_nl.ts
</pre>
<p>Using a locale within the translation file name is useful for determining which language to load at runtime. This is explained in <ahref="linguist-manual-4.html">Chapter 4: Programmers</a>.</p>
<!-- index HEADERS!in Project Files --><!-- index SOURCES!in Project Files --><!-- index FORMS!in Project Files --><!-- index TRANSLATIONS!in Project Files --><p>An example of a complete <tt>.pro</tt> file with four translation source files:</p>
<!-- index TQApplication!defaultCodec() --><!-- index defaultCodec()!TQApplication --><!-- index DEFAULTCODEC!in Project Files --><!-- index Chinese Language --><!-- index Japanese Language --><p><ahref="ntqtextcodec.html#setCodecForTr">TQTextCodec::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 Latin-1.</p>
<p>If you do use the <ahref="ntqtextcodec.html#codecForTr">TQTextCodec::codecForTr</a>() mechanism in your application, <em>TQt Linguist</em> needs you to set the <tt>DEFAULTCODEC</tt> entry in the <tt>.pro</tt> file as well. For example:</p>
<!-- index lupdate --><p>Usage: <tt>lupdate myproject.pro</tt></p>
<!-- index TQt Designer --><p>This is a simple command line tool. <ahref="linguist-manual-2.html#2">lupdate</a> reads a TQt <tt>.pro</tt> project file, finds the translatable strings in the specified source, header and <em>TQt Designer</em> interface files, and produces or updates the <tt>.ts</tt> translation files listed in the project file. The translation files are given to the translator who uses <em>TQt Linguist</em> to read the files and insert the translations.</p>
<p>Companies that have their own translators in-house may find it useful to run <ahref="linguist-manual-2.html#2">lupdate</a> regularly, perhaps monthly, as the application develops. This will lead to a fairly low volume of translation work spread evenly over the life of the project and will allow the translators to support a number of projects simultaneously.</p>
<p>Companies that hire in translators as required may prefer to run <ahref="linguist-manual-2.html#2">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 <ahref="linguist-manual-2.html#2">lupdate</a> runs would probably take place during the final beta phase.</p>
<!-- index .ts Files --><!-- index Translation Source Files --><!-- index XML --><p>The <tt>.ts</tt> file format is a simple human-readable XML format that can be used with version control systems if required.</p>
<!-- index lrelease --><p>Usage: <tt>lrelease myproject.pro</tt></p>
<!-- index .qm Files --><!-- index TQt Message Files --><p>This is another simple command line tool. It reads a TQt <tt>.pro</tt> project file and produces the <tt>.qm</tt> files used by the application, one for each <tt>.ts</tt> translation source file listed in the project file. The <tt>.qm</tt> file format is a compact binary format that provides extremely fast lookups for translations.</p>
<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>
<p>Note that <ahref="linguist-manual-2.html#3">lrelease</a> will only incorporate translations that are marked as "done". If a translation is missing, or has failed validation, the original text will be used instead.</p>
<h3><aname="4"></a>Missing Translations</h3>
<p>Both <ahref="linguist-manual-2.html#2">lupdate</a> and <ahref="linguist-manual-2.html#3">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>