<!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>popuretext — 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="poreencode" href="poreencode.html" /> <link rel="prev" title="pomigrate2" href="pomigrate2.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="#">popuretext</a><ul> <li><a class="reference internal" href="#prerequisites">Prerequisites</a></li> <li><a class="reference internal" href="#usage">Usage</a></li> <li><a class="reference internal" href="#examples">Examples</a></li> </ul> </li> </ul> </ul> </li> <li><a href="pomigrate2.html" title="previous chapter">« pomigrate2</a></li> <li><a href="poreencode.html" title="next chapter">poreencode »</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="popuretext"> <span id="id1"></span><h1>popuretext<a class="headerlink" href="#popuretext" title="Permalink to this headline">¶</a></h1> <p>Extracts all the source text from a directory of POT files or the target text from a directory of PO files, removing PO headers and optionally the accelerator keys.</p> <p>If you want to use other tools to analyse the text within a translation project, then this is the tool for you. For example, you can use it to calculate word frequencies to create an initial glossary based on the pure source text.</p> <div class="section" id="prerequisites"> <span id="popuretext-prerequisites"></span><h2>Prerequisites<a class="headerlink" href="#prerequisites" title="Permalink to this headline">¶</a></h2> <ul class="simple"> <li>GNU Gettext</li> <li>sed</li> </ul> </div> <div class="section" id="usage"> <span id="popuretext-usage"></span><h2>Usage<a class="headerlink" href="#usage" title="Permalink to this headline">¶</a></h2> <div class="highlight-python"><pre>popuretext <-P pot-dir|po-dir> <file.txt> [accelerator]</pre> </div> <p>Where:</p> <table border="1" class="docutils"> <colgroup> <col width="19%" /> <col width="81%" /> </colgroup> <tbody valign="top"> <tr class="row-odd"><td>pot-dir</td> <td>a directory containing POT files</td> </tr> <tr class="row-even"><td>po-dir</td> <td>a directory containing PO files</td> </tr> <tr class="row-odd"><td>file.txt</td> <td>file that contains the output text</td> </tr> <tr class="row-even"><td>accelerator</td> <td>optional: accelerator marker to be removed from the text</td> </tr> </tbody> </table> </div> <div class="section" id="examples"> <span id="popuretext-examples"></span><h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2> <div class="highlight-python"><pre>popuretext -P pot pot.txt '&'</pre> </div> <p>Extract all the source text from the <em>pot</em> directory and place it in the <em>pot.txt</em> file removing all occurrences of the <tt class="docutils literal"><span class="pre">&</span></tt> accelerator.</p> <div class="highlight-python"><pre>popuretext af af.txt</pre> </div> <p>Extract all target text from the Afrikaans files in the <em>af</em> directory, placing the extracted text in <em>af.txt</em>. In this case we are not filtering any accelerator characters.</p> </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> © 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>