Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > f9d20baf2d42bbb9f9c5746dba0abad5 > files > 227

python-translate-doc-1.10.0-3.mga4.noarch.rpm


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>pot2po &mdash; Translate Toolkit 1.9.0 documentation</title>
    
    <link rel="stylesheet" href="../_static/basic.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../_static/bootstrap.css" type="text/css" />
    <link rel="stylesheet" href="../_static/bootstrap-sphinx.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '1.9.0',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/bootstrap.js"></script>
    <script type="text/javascript" src="../_static/bootstrap-sphinx.js"></script>
    <link rel="top" title="Translate Toolkit 1.9.0 documentation" href="../index.html" />
    <link rel="up" title="Converters" href="index.html" />
    <link rel="next" title="csv2po" href="csv2po.html" />
    <link rel="prev" title="po2tmx" href="po2tmx.html" /> 
  </head>
  <body>
  <div id="navbar" class="navbar navbar-fixed-top">
    <div class="navbar-inner">
      <div class="container-fluid">
        <a class="brand" href="../index.html">Translate Toolkit</a>
        <span class="navbar-text pull-left"><b>1.9.0</b></span>
          <ul class="nav">
            <li class="divider-vertical"></li>
            
              <li class="dropdown">
  <a href="#" class="dropdown-toggle" data-toggle="dropdown">Site <b class="caret"></b></a>
  <ul class="dropdown-menu globaltoc"><ul class="simple">
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../features.html">Features</a></li>
<li class="toctree-l1"><a class="reference internal" href="../installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html">Converters</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#tools">Tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#scripts">Scripts</a></li>
<li class="toctree-l1"><a class="reference internal" href="../guides/index.html">Use Cases</a></li>
<li class="toctree-l1"><a class="reference internal" href="../formats/index.html">Supported formats</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../styleguide.html">Translate Styleguide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../styleguide.html#documentation">Documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../development/building.html">Building</a></li>
<li class="toctree-l1"><a class="reference internal" href="../development/contributing.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../development/developers.html">Translate Toolkit Developers Guide</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../api/index.html">API</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../changelog.html">Important Changes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../history.html">History of the Translate Toolkit</a></li>
<li class="toctree-l1"><a class="reference internal" href="../license.html">License</a></li>
</ul>
</ul>
</li>
              
<li class="dropdown">
  <a href="#" class="dropdown-toggle" data-toggle="dropdown">Page <b class="caret"></b></a>
  <ul class="dropdown-menu localtoc"><ul>
<li><a class="reference internal" href="#">pot2po</a><ul>
<li><a class="reference internal" href="#usage">Usage</a></li>
<li><a class="reference internal" href="#examples">Examples</a></li>
<li><a class="reference internal" href="#merging">Merging</a></li>
<li><a class="reference internal" href="#performance">Performance</a></li>
<li><a class="reference internal" href="#bugs">Bugs</a></li>
</ul>
</li>
</ul>
</ul>
</li>
            
            
              
  <li><a href="po2tmx.html"
         title="previous chapter">&laquo; po2tmx</a></li>
  <li><a href="csv2po.html"
         title="next chapter">csv2po &raquo;</a></li>
            
            
              
            
          </ul>
          
            
<form class="navbar-search pull-right" action="../search.html" method="get">
  <input type="text" name="q" placeholder="Search" />
  <input type="hidden" name="check_keywords" value="yes" />
  <input type="hidden" name="area" value="default" />
</form>
          
          </ul>
        </div>
      </div>
    </div>
  </div>

<div class="container content">
   
  <div class="section" id="pot2po">
<span id="id1"></span><h1>pot2po<a class="headerlink" href="#pot2po" title="Permalink to this headline">¶</a></h1>
<p>Convert a Gettext PO Template file to a PO file and merge in existing
translations if they are present. A translation memory (compendium) can also be
used for fuzzy matching. This corresponds to a large extent with the program
&#8220;msgmerge&#8221; from the gettext package.</p>
<div class="section" id="usage">
<span id="pot2po-usage"></span><h2>Usage<a class="headerlink" href="#usage" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><pre>pot2po [options] &lt;pot&gt; &lt;po&gt;</pre>
</div>
<p>Where:</p>
<table border="1" class="docutils">
<colgroup>
<col width="12%" />
<col width="88%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td>&lt;pot&gt;</td>
<td>is a PO Template (POT) file or directory of POT files</td>
</tr>
<tr class="row-even"><td>&lt;po&gt;</td>
<td>is a PO file or a directory of PO files</td>
</tr>
</tbody>
</table>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">--version</span></kbd></td>
<td>show program&#8217;s version number and exit</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-h</span>, <span class="option">--help</span></kbd></td>
<td>show this help message and exit</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--manpage</span></kbd></td>
<td>output a manpage based on the help</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--progress=<var>PROGRESS</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>show progress as: <a class="reference internal" href="option_progress.html"><em>dots, none, bar, names, verbose</em></a></td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--errorlevel=<var>ERRORLEVEL</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>show errorlevel as: <a class="reference internal" href="option_errorlevel.html"><em>none, message, exception,
traceback</em></a></td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-i<var>INPUT</var></span>, <span class="option">--input=<var>INPUT</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>read from INPUT in pot format</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-x<var>EXCLUDE</var></span>, <span class="option">--exclude=<var>EXCLUDE</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>exclude names matching EXCLUDE from input paths</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-o<var>OUTPUT</var></span>, <span class="option">--output=<var>OUTPUT</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>write to OUTPUT in po, pot formats</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-t<var>TEMPLATE</var></span>, <span class="option">--template=<var>TEMPLATE</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>read from TEMPLATE in po, pot formats (old translations)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--psyco=<var>MODE</var></span></kbd></td>
<td>use psyco to speed up the operation, modes: <a class="reference internal" href="option_psyco.html"><em>none,
full, profile</em></a></td></tr>
<tr><td class="option-group">
<kbd><span class="option">-P</span>, <span class="option">--pot</span></kbd></td>
<td>output PO Templates (.pot) rather than PO files (.po)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--tm=<var>TM</var></span></kbd></td>
<td>The file to use as translation memory when fuzzy matching</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-s<var>MIN_SIMILARITY</var></span>, <span class="option">--similarity=<var>MIN_SIMILARITY</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>The minimum similarity for inclusion (default: 75%)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--nofuzzymatching</span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>Disable all fuzzy matching</td></tr>
</tbody>
</table>
</div>
<div class="section" id="examples">
<span id="pot2po-examples"></span><h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><pre>pot2po -t zu-1.0.1 pot-2.0.2 zu-2.0.2</pre>
</div>
<p>Here we are initialising the PO files in <em>zu-2.0.2</em> based on the POT files in
<em>pot-2.0.2</em>.  We are using the old translations in <em>zu-1.0.1</em> as templates so
that we can reuse our existing translations in the new files.</p>
<p>If the POT files have undergone major reshuffling then you may want to use
<a class="reference internal" href="pomigrate2.html"><em>pomigrate2</em></a> which can now use pot2po as its merging backend.  pomigrate2
will do its best to migrate your files to the correct locations before merging.
It will also make make use of a compendium if requested.:</p>
<div class="highlight-python"><pre>pot2po --tm=compendium.po --similarity=60 -t xh-old pot xh-new</pre>
</div>
<p>With this update we are using <em>compendium.po</em> as a translations memory (you can
make use of other files such as TMX, etc).  We will accept any match that
scores above <em>60%</em>.</p>
</div>
<div class="section" id="merging">
<span id="pot2po-merging"></span><h2>Merging<a class="headerlink" href="#merging" title="Permalink to this headline">¶</a></h2>
<p>It helps to understand when and how pot2po will merge. The default is to follow
msgmerge&#8217;s behaviour but we add some extra features with fuzzy matching:</p>
<ul class="simple">
<li>If everything matches we carry that across</li>
<li>We can resurrect obsolete messages for reuse</li>
<li>Messages no longer used are made obsolete</li>
<li>If we cannot find a match we will first look through the current and obsolete
messages and then through any global translation memory</li>
<li>Fuzzy matching makes use of the <a class="reference internal" href="levenshtein_distance.html"><em>Levenshtein distance</em></a>
algorithm to detect the best matches</li>
</ul>
</div>
<div class="section" id="performance">
<span id="pot2po-performance"></span><h2>Performance<a class="headerlink" href="#performance" title="Permalink to this headline">¶</a></h2>
<p>Fuzzy matches are usually of good quality. Installation of the
<a class="reference external" href="https://sourceforge.net/project/showfiles.php?group_id=91920&amp;package_id=260161">python-Levenshtein</a>
package will speed up fuzzy matching. Without this a Python based matcher is
used which is considerably slower.</p>
<p>Install psyco for additional speedup (it is used by most toolkit tools if it is
installed.)</p>
</div>
<div class="section" id="bugs">
<span id="pot2po-bugs"></span><h2>Bugs<a class="headerlink" href="#bugs" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li><a class="reference internal" href="pomerge.html"><em>pomerge</em></a> and pot2po should probably become one.</li>
</ul>
</div>
</div>


</div>
<hr>

<footer class="footer">
  <div class="container">
    <p class="pull-right"><a href="#">Back to top ↑</a></p>
    <ul class="unstyled muted">
      <li><small>
        &copy; 2012, Translate.org.za.<br/>
      </small></li>
      <li><small>
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
      </small></li>
    </ul>
  </div>
</footer>
  </body>
</html>