Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > ff187cb994c94c614ecc64c5a8528b1b > files > 3941

qt-doc-4.8.5-10.fc18.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- linguist-manual.qdoc -->
  <title>Qt 4.8: Qt Linguist Manual: Release Manager</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li>Qt Linguist Manual: Release Manager</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
  <link rel="prev" href="linguist-manual.html" />
  <link rel="next" href="linguist-translators.html" />
<p class="naviNextPrevious headerNavi">
<a class="prevPage" href="linguist-manual.html">Qt Linguist Manual</a>
<a class="nextPage" href="linguist-translators.html">Qt Linguist Manual: Translators</a>
</p><p/>
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#qt-project-files">Qt Project Files</a></li>
<li class="level1"><a href="#lupdate">lupdate</a></li>
<li class="level1"><a href="#lrelease">lrelease</a></li>
<li class="level1"><a href="#missing-translations">Missing Translations</a></li>
</ul>
</div>
<h1 class="title">Qt Linguist Manual: Release Manager</h1>
<span class="subtitle"></span>
<!-- $$$linguist-manager.html-description -->
<div class="descr"> <a name="details"></a>
<p>Two tools are provided for the release manager, <a href="#lupdate">lupdate</a> and <a href="#lrelease">lrelease</a>. These tools can process <a href="qmake-manual.html#qmake">qmake</a> project files, or operate directly on the file system.</p>
<a name="qt-project-files"></a>
<h2>Qt Project Files</h2>
<p>The easiest method to use <a href="#lupdate">lupdate</a> and <a href="#lrelease">lrelease</a> is by specifying a <tt>.pro</tt> Qt 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>
<pre class="cpp"> TRANSLATIONS = arrowpad_fr.ts \
                arrowpad_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 the <a href="linguist-programmers.html">Programmers</a> chapter.</p>
<p>An example of a complete <tt>.pro</tt> file with four translation source files:</p>
<pre class="cpp"> HEADERS         = main-dlg.h \
                   options-dlg.h
 SOURCES         = main-dlg.cpp \
                   options-dlg.cpp \
                   main.cpp
 FORMS           = search-dlg.ui
 TRANSLATIONS    = superapp_dk.ts \
                   superapp_fi.ts \
                   superapp_no.ts \
                   superapp_se.ts
 CODECFORTR      = ISO-8859-5</pre>
<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>
<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>
<pre class="cpp"> CODECFORTR      = ISO-8859-5</pre>
<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>
<pre class="cpp"> CODECFORSRC     = UTF-8</pre>
<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>
<pre class="cpp"> label<span class="operator">-</span><span class="operator">&gt;</span>setText(tr(<span class="string">&quot;F\374r \310lise&quot;</span>));</pre>
<a name="lupdate"></a>
<h2>lupdate</h2>
<p>Usage: <tt>lupdate myproject.pro</tt></p>
<p><a href="#lupdate">lupdate</a> is a command line tool that finds the translatable strings in the specified source, header and <i>Qt Designer</i> interface files, and produces or updates <tt>.ts</tt> translation files. The files to process and the files to update can be set at the command line, or provided in a <tt>.pro</tt> file specified as an command line argument. The produced translation files are given to the translator who uses <i>Qt Linguist</i> to read the files and insert the translations.</p>
<p>Companies that have their own translators in-house may find it useful to run <a href="#lupdate">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 <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>
<p>The TS 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; files in this format typically have file names that end with the <tt>.xlf</tt> suffix.</p>
<p><b>Note:</b> The minimum supported version for XLIFF format files is 1.1&#x2e; XLIFF 1.0 version files are not supported.</p>
<p>Pass the <tt>-help</tt> option to <tt>lupdate</tt> to obtain the list of supported options:</p>
<pre class="cpp"> Usage:
     lupdate [options] [project-file]
     lupdate [options] [source-file|path]... -ts ts-files
 Options:
     -help  Display this information and exit.
     -noobsolete
            Drop all obsolete strings.
     -extensions &lt;ext&gt;[,&lt;ext&gt;]...
            Process files with the given extensions only.
            The extension list must be separated with commas, not with whitespace.
            Default: 'ui,c,c++,cc,cpp,cxx,ch,h,h++,hh,hpp,hxx'.
     -pluralonly
            Only include plural form messages.
     -silent
            Do not explain what is being done.
     -version
            Display the version of lupdate and exit.</pre>
<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>
<a name="lrelease"></a>
<h2>lrelease</h2>
<p>Usage: <tt>lrelease myproject.pro</tt></p>
<p><a href="#lrelease">lrelease</a> is a command line tool that produces QM files out of TS files. The QM file format is a compact binary format that is used by the localized application. It provides extremely fast lookups for translations. The TS files <a href="#lrelease">lrelease</a> processes can be specified at the command line, or given indirectly by a Qt <tt>.pro</tt> project file.</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 QM 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 QM files are available the application will detect them and use them automatically.</p>
<p>Note that <a href="#lrelease">lrelease</a> will only incorporate translations that are marked as &quot;finished&quot;. Otherwise the original text will be used instead.</p>
<p>Pass the <tt>-help</tt> option to <tt>lrelease</tt> to obtain the list of supported options:</p>
<pre class="cpp"> Usage:
     lrelease [options] project-file
     lrelease [options] ts-files [-qm qm-file]

 lrelease is part of Qt's Linguist tool chain. It can be used as a
 stand-alone tool to convert XML-based translations files in the TS
 format into the 'compiled' QM format used by QTranslator objects.

 Options:
     -help  Display this information and exit
     -idbased
            Use IDs instead of source strings for message keying
     -compress
            Compress the QM files
     -nounfinished
            Do not include unfinished translations
     -removeidentical
            If the translated text is the same as
            the source text, do not include the message
     -markuntranslated &lt;prefix&gt;
            If a message has no real translation, use the source text
            prefixed with the given string instead
     -silent
            Do not explain what is being done
     -version
            Display the version of lrelease and exit</pre>
<a name="missing-translations"></a>
<h2>Missing Translations</h2>
<p>Both <a href="#lupdate">lupdate</a> and <a href="#lrelease">lrelease</a> may be used with TS translation source files which are incomplete. Missing translations will be replaced with the native language phrases at runtime.</p>
</div>
<!-- @@@linguist-manager.html -->
<p class="naviNextPrevious footerNavi">
<a class="prevPage" href="linguist-manual.html">Qt Linguist Manual</a>
<a class="nextPage" href="linguist-translators.html">Qt Linguist Manual: Translators</a>
</p>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2013 Digia Plc and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Digia, Qt and their respective logos are trademarks of Digia Plc 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>