Sophie

Sophie

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

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>oo2po &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="odf2xliff and xliff2odf" href="odf2xliff.html" />
    <link rel="prev" title="moz2po" href="moz2po.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="#">oo2po</a><ul>
<li><a class="reference internal" href="#usage">Usage</a></li>
<li><a class="reference internal" href="#examples">Examples</a><ul>
<li><a class="reference internal" href="#creating-pot-files">Creating POT files</a></li>
<li><a class="reference internal" href="#creating-po-files-from-existing-work">Creating PO files from existing work</a></li>
<li><a class="reference internal" href="#creating-a-new-gsi-sdf-file">Creating a new GSI/SDF file</a></li>
</ul>
</li>
<li><a class="reference internal" href="#helpcontent2">helpcontent2</a></li>
</ul>
</li>
</ul>
</ul>
</li>
            
            
              
  <li><a href="moz2po.html"
         title="previous chapter">&laquo; moz2po</a></li>
  <li><a href="odf2xliff.html"
         title="next chapter">odf2xliff and xliff2odf &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="xliff2oo">
<span id="oo2xliff"></span><span id="po2oo"></span><span id="oo2po"></span><span id="id1"></span><h1>oo2po<a class="headerlink" href="#xliff2oo" title="Permalink to this headline">¶</a></h1>
<p>Convert between OpenOffice.org GSI/SDF files and the PO format.  This tool
provides a complete roundtrip; it preserves the structure of the GSI file and
creates completely valid PO files.</p>
<p>oo2xliff will convert the SDF files to XLIFF format.</p>
<div class="section" id="usage">
<span id="oo2po-usage"></span><h2>Usage<a class="headerlink" href="#usage" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><pre>oo2po [options] &lt;sdf&gt; &lt;output&gt;
po2oo [options] [-t &lt;en-US.sdf&gt;] -l &lt;targetlang&gt; &lt;input&gt; &lt;sdf|output&gt;</pre>
</div>
<p>or for XLIFF files:</p>
<div class="highlight-python"><pre>oo2xliff [options] -l &lt;targetlang&gt; &lt;sdf&gt; &lt;output&gt;
xliff2oo [options] [-t &lt;en-US.sdf&gt;] -l &lt;targetlang&gt; &lt;input&gt; &lt;sdf|output&gt;</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>&lt;sdf&gt;</td>
<td>is a valid OpenOffice.org GSI or SDF files</td>
</tr>
<tr class="row-even"><td>&lt;output&gt;</td>
<td>is a directory for the resultant PO/POT/XLIFF files</td>
</tr>
<tr class="row-odd"><td>&lt;input&gt;</td>
<td>is a directory of translated PO/XLIFF files</td>
</tr>
<tr class="row-even"><td>&lt;targetlang&gt;</td>
<td>is the <a class="reference external" href="https://en.wikipedia.org/wiki/ISO_639">ISO 639</a>
language code used in the sdf file, e.g. af</td>
</tr>
</tbody>
</table>
<p>Options (oo2po and oo2xliff):</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 oo 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">
<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) (only available in oo2po</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-l<var>LANG</var></span>, <span class="option">--language=<var>LANG</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>set target language to extract from oo file (e.g. af-ZA) (required for oo2xliff)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--source-language=<var>LANG</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>set source language code (default en-US)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--nonrecursiveinput</span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>don&#8217;t treat the input oo as a recursive store</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--duplicates=<var>DUPLICATESTYLE</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>what to do with duplicate strings (identical source
text): <a class="reference internal" href="option_duplicates.html"><em>merge, msgctxt</em></a>
(default: &#8216;msgctxt&#8217;)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--multifile=<var>MULTIFILESTYLE</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>how to split po/pot files (<a class="reference internal" href="option_multifile.html"><em>single, toplevel or
onefile</em></a>)</td></tr>
</tbody>
</table>
<p>Options (po2oo and xliff2oo):</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 po, pot formats</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 oo format</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 oo format</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" colspan="2">
<kbd><span class="option">-l<var>LANG</var></span>, <span class="option">--language=<var>LANG</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>set target language code (e.g. af-ZA) [required]</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--source-language=<var>LANG</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>set source language code (default en-US)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-T</span>, <span class="option">--keeptimestamp</span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>don&#8217;t change the timestamps of the strings</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--nonrecursiveoutput</span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>don&#8217;t treat the output oo as a recursive store</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--nonrecursivetemplate</span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>don&#8217;t treat the template oo as a recursive store</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--filteraction=<var>ACTION</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>action on pofilter failure: <a class="reference internal" href="option_filteraction.html"><em>none (default), warn,
exclude-serious, exclude-all</em></a></td></tr>
<tr><td class="option-group">
<kbd><span class="option">--fuzzy</span></kbd></td>
<td>use translations marked fuzzy</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--nofuzzy</span></kbd></td>
<td>don&#8217;t use translations marked fuzzy (default)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--multifile=<var>MULTIFILESTYLE</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>how to split po/pot files (<a class="reference internal" href="option_multifile.html"><em>single, toplevel or
onefile</em></a>)</td></tr>
</tbody>
</table>
</div>
<div class="section" id="examples">
<span id="oo2po-examples"></span><h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<p>These examples demonstrate most of the useful invocations of oo2po:</p>
<div class="section" id="creating-pot-files">
<span id="oo2po-creating-pot-files"></span><h3>Creating POT files<a class="headerlink" href="#creating-pot-files" title="Permalink to this headline">¶</a></h3>
<div class="highlight-python"><pre>oo2po -P en-US.sdf pot</pre>
</div>
<p>Extract messages from <em>en-US.sdf</em> and place them in a directory called <em>pot</em>.
The <tt class="docutils literal"><span class="pre">-P</span></tt> option ensures that we create POT files instead of PO files.</p>
<div class="highlight-python"><pre>oo2po -P --source-language=fr fr-FR.sdf french-pot</pre>
</div>
<p>Instead of creating English POT files we are now creating POT files that
contain French in the msgid.  This is useful for translators who are not
English literate.  You will need to have a fully translated sdf in the source
language.</p>
</div>
<div class="section" id="creating-po-files-from-existing-work">
<span id="oo2po-creating-po-files-from-existing-work"></span><h3>Creating PO files from existing work<a class="headerlink" href="#creating-po-files-from-existing-work" title="Permalink to this headline">¶</a></h3>
<div class="highlight-python"><pre>oo2po --duplicates=merge -l zu zu-ZA.sdf zulu</pre>
</div>
<p>Extract all existing Zulu (<em>zu</em>) messages from <em>zu-ZA.sdf</em> and place them in a
directory called <em>zulu</em>.  If you find duplicate messages in a file then merge
them into a single message (This is the default behaviour for traditional PO
files).  You might want to use <a class="reference internal" href="pomigrate2.html"><em>pomigrate2</em></a> to ensure that your PO files
match the latest POT files.:</p>
<div class="highlight-python"><pre>cat GSI_af.sdf GSI_xh.sdf &gt; GSI_af-xh.sdf oo2po --source-language=af -l xh</pre>
</div>
<p>GSI_af-xh.sdf af-xh-po</p>
<p>Here we are creating PO files with your existing translations but a different
source language.  Firstly we combine the two SDF files.  Then oo2po creates a
set of PO files in <em>af-xh-po</em> using Afrikaans (<em>af</em>) as the source language and
Xhosa (<em>xh</em>) as the target language from the combined SDF file <em>GSI_af-xh.sdf</em></p>
</div>
<div class="section" id="creating-a-new-gsi-sdf-file">
<span id="oo2po-creating-a-new-gsi-sdf-file"></span><h3>Creating a new GSI/SDF file<a class="headerlink" href="#creating-a-new-gsi-sdf-file" title="Permalink to this headline">¶</a></h3>
<div class="highlight-python"><pre>po2oo -l zu zulu zu_ZA.sdf</pre>
</div>
<p>Using PO files found in <em>zulu</em> create an SDF files called <em>zu_ZA.sdf</em> for
language <em>zu</em>:</p>
<div class="highlight-python"><pre>po2oo -l af -t en-US.sdf --nofuzzy --keeptimestamp --filteraction=exclude-serious afrikaans af_ZA.sdf</pre>
</div>
<p>Create an Afrikaans (<em>af</em>) SDF file called <em>af_ZA.sdf</em> using <em>en-US.sdf</em> as a
template and preserving the timestamps within the SDF file while also
eliminating any serious errors in translation.  Using templates ensures that
the resultant SDF file has exactly the same format as the template SDF file.
In an SDF file each translated string can have a timestamp attached.  This
creates a large amount of unuseful traffic when comparing version of the SDF
file, by preserving the timestamp we ensure that this does not change and can
therefore see the translation changes clearly.  We have included the <em>nofuzzy</em>
option (on by default) that prevent fuzzy PO messages from getting into the SDF
file.  Lastly the <em>filteraction</em> option is set to exclude serious errors:
variables failures and translated XML will be excluded from the final SDF.</p>
</div>
</div>
<div class="section" id="helpcontent2">
<span id="oo2po-helpcontent2"></span><h2>helpcontent2<a class="headerlink" href="#helpcontent2" title="Permalink to this headline">¶</a></h2>
<p>The escaping of <tt class="docutils literal"><span class="pre">helpcontent2</span></tt> from SDF files was very confusing, <a class="reference external" href="http://bugs.locamotion.org/show_bug.cgi?id=295">bug 295</a>
implemented a fix that appeared in version 1.1.0 (All known issues were fixed
in 1.1.1).  Translators are now able to translate helpcontent2 with clean
escaping.</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>
        &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>