<!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>General Usage — 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="moz2po" href="moz2po.html" /> <link rel="prev" title="Converters" href="index.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="#">General Usage</a><ul> <li><a class="reference internal" href="#input-output">Input & Output</a></li> <li><a class="reference internal" href="#error-reporting">Error Reporting</a></li> <li><a class="reference internal" href="#templates">Templates</a></li> <li><a class="reference internal" href="#source2target">source2target</a></li> <li><a class="reference internal" href="#getting-help">Getting Help</a></li> </ul> </li> </ul> </ul> </li> <li><a href="index.html" title="previous chapter">« Converters</a></li> <li><a href="moz2po.html" title="next chapter">moz2po »</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="general-usage"> <span id="id1"></span><h1>General Usage<a class="headerlink" href="#general-usage" title="Permalink to this headline">¶</a></h1> <p>The tools follow a general usage convention which is helpful to understand.</p> <div class="section" id="input-output"> <span id="general-usage-input-output"></span><h2>Input & Output<a class="headerlink" href="#input-output" title="Permalink to this headline">¶</a></h2> <p>The last two arguments of your command are the input and output files/directories:</p> <div class="highlight-python"><pre>moz2po <input> <output></pre> </div> <p>You can of course still us the <tt class="docutils literal"><span class="pre">-i</span></tt> and <tt class="docutils literal"><span class="pre">-o</span></tt> options which allows you to reorder commands</p> <div class="highlight-python"><pre>moz2po -o <output> -i <input></pre> </div> </div> <div class="section" id="error-reporting"> <span id="general-usage-error-reporting"></span><h2>Error Reporting<a class="headerlink" href="#error-reporting" title="Permalink to this headline">¶</a></h2> <p>All tools accept the option <tt class="docutils literal"><span class="pre">--errorlevel</span></tt>. If you find a bug, add this option and send the traceback to the developers.</p> <div class="highlight-python"><div class="highlight"><pre><span class="n">moz2po</span> <span class="o"><</span><span class="n">other</span><span class="o">-</span><span class="n">options</span><span class="o">></span> <span class="o">--</span><span class="n">errorlevel</span><span class="o">=</span><span class="n">traceback</span> </pre></div> </div> </div> <div class="section" id="templates"> <span id="general-usage-templates"></span><h2>Templates<a class="headerlink" href="#templates" title="Permalink to this headline">¶</a></h2> <p>If you are working with any file format and you wish to preserve comments and layout then use your source file as a template.</p> <div class="highlight-python"><pre>po2dtd -t <source-file> <input> <output></pre> </div> <p>This will use the files in <tt class="docutils literal"><span class="pre"><source-file></span></tt> as a template, merge the PO files in <tt class="docutils literal"><span class="pre"><input></span></tt>, and create new DTD files in <tt class="docutils literal"><span class="pre"><output></span></tt></p> <p>If you ran this without the templates you would get valid DTD files but they would not preserve the layout or all the comments from the source DTD file</p> <p>The same concept of templates is also used when you merge files.</p> <div class="highlight-python"><pre>pomerge -t <old> <fixes> <new></pre> </div> <p>This would take the <tt class="docutils literal"><span class="pre"><old></span></tt> files merge in the <tt class="docutils literal"><span class="pre"><fixes></span></tt> and output new PO files, preserving formatting, into <tt class="docutils literal"><span class="pre"><new></span></tt>. You can use the same directory for <tt class="docutils literal"><span class="pre"><old></span></tt> and <tt class="docutils literal"><span class="pre"><new></span></tt> if you want the merges to overwrite files in <tt class="docutils literal"><span class="pre"><old></span></tt>.</p> </div> <div class="section" id="source2target"> <span id="general-usage-source2target"></span><h2>source2target<a class="headerlink" href="#source2target" title="Permalink to this headline">¶</a></h2> <p>The converters all follow this convention:</p> <ul class="simple"> <li>source = the format from which you are converting e.g. in <a class="reference internal" href="oo2po.html"><em>oo2po</em></a> we are converting from OpenOffice.org SDF/GSI</li> <li>target = the format into which you are converting e.g. in <a class="reference internal" href="oo2po.html"><em>oo2po</em></a> we are converting to Gettext PO</li> </ul> </div> <div class="section" id="getting-help"> <span id="general-usage-getting-help"></span><h2>Getting Help<a class="headerlink" href="#getting-help" title="Permalink to this headline">¶</a></h2> <p>The <tt class="docutils literal"><span class="pre">--help</span></tt> option will always list the available commands for the tool.</p> <div class="highlight-python"><div class="highlight"><pre><span class="n">moz2po</span> <span class="o">--</span><span class="n">help</span> </pre></div> </div> </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>