<!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>Creating Mozilla POT files — 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="Use Cases" href="index.html" /> <link rel="next" title="Migrating Mozilla Translations to Firefox" href="migrating_to_firefox.html" /> <link rel="prev" title="Cleanup translator comments" href="cleanup_translator_comments.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="../commands/index.html">Converters</a></li> <li class="toctree-l1"><a class="reference internal" href="../commands/index.html#tools">Tools</a></li> <li class="toctree-l1"><a class="reference internal" href="../commands/index.html#scripts">Scripts</a></li> <li class="toctree-l1"><a class="reference internal" href="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="#">Creating Mozilla POT files</a><ul> <li><a class="reference internal" href="#using-mercurial">Using Mercurial</a></li> <li><a class="reference internal" href="#using-cvs">Using CVS</a></li> <li><a class="reference internal" href="#using-an-en-us-xpi-file">Using an en-US XPI file</a></li> </ul> </li> </ul> </ul> </li> <li><a href="cleanup_translator_comments.html" title="previous chapter">« Cleanup translator comments</a></li> <li><a href="migrating_to_firefox.html" title="next chapter">Migrating Mozilla Translations to Firefox »</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="creating-mozilla-pot-files"> <span id="id1"></span><h1>Creating Mozilla POT files<a class="headerlink" href="#creating-mozilla-pot-files" title="Permalink to this headline">¶</a></h1> <p>You can do this two ways:</p> <ul class="simple"> <li>Using Mozilla source (from CVS or Mercurial)</li> <li>Using an en-US XPI file</li> </ul> <div class="section" id="using-mercurial"> <span id="creating-mozilla-pot-files-using-mercurial"></span><h2>Using Mercurial<a class="headerlink" href="#using-mercurial" title="Permalink to this headline">¶</a></h2> <p>Since Firefox 3.1 and Thunderbird 3.0, Mozilla has switched to using Mercurial for version control. See the Mozilla’s <a class="reference external" href="https://developer.mozilla.org/en/l10n_on_mercurial">L10n on Mercurial</a> page for instructions on how to checkout and update your Mozilla sources and l10n files.</p> <p>You can use <a class="reference internal" href="../commands/mozilla_l10n_scripts.html#mozilla-l10n-scripts-get-moz-enus-py"><em>get_moz_enUS.py</em></a> to extract an en-US directory from the source tree:</p> <div class="highlight-python"><pre>get_moz_enUS.py -s mozilla-central/ -d l10n/ -p browser</pre> </div> <p>This will move the correct en-US files to <tt class="docutils literal"><span class="pre">l10n/en-US</span></tt>. You can now create POT files as follows:</p> <div class="highlight-python"><pre>moz2po -P l10n/en-US l10n/pot</pre> </div> <p>This will create the POT files in <tt class="docutils literal"><span class="pre">l10n/pot</span></tt> using the American English files from <tt class="docutils literal"><span class="pre">en-US</span></tt>. You now have a set of POT files that you can use for translation or updating your existing PO files.</p> <p>There are also <a class="reference internal" href="../commands/mozilla_l10n_scripts.html"><em>other scripts</em></a> that can help with creating and updating POT and PO files for Mozilla localisation.</p> </div> <div class="section" id="using-cvs"> <span id="creating-mozilla-pot-files-using-cvs"></span><h2>Using CVS<a class="headerlink" href="#using-cvs" title="Permalink to this headline">¶</a></h2> <p>Firefox versions before 3.1 and Thunderbird versions before 3.0 still has its source in CVS. Check out files from the Mozilla repository. If you don’t want to checkout all files do:</p> <div class="highlight-python"><pre>make -f client.mk l10n-checkout</pre> </div> <p>The English files are in the <tt class="docutils literal"><span class="pre">mozilla/</span></tt> module, while the translated files all reside in the <tt class="docutils literal"><span class="pre">l10n/</span></tt> module. They have different structure but not enough to kill you.</p> <p>Once you have checked out <tt class="docutils literal"><span class="pre">mozilla/</span></tt> you will need to get the correct files for en-US. To do this we will create en-US as a pseudo language.</p> <div class="highlight-python"><pre>make -f tools/l10n/l10n.mk create-en-US</pre> </div> <p>This will move the correct en-US files to <tt class="docutils literal"><span class="pre">l10n/en-US</span></tt>. You can now create POT files as follows:</p> <div class="highlight-python"><pre>moz2po -P l10n/en-US l10n/pot</pre> </div> <p>This will create the POT files in <tt class="docutils literal"><span class="pre">l10n/pot</span></tt> using the American English files from <tt class="docutils literal"><span class="pre">en-US</span></tt>. You now have a set of POT files that you can use for translation or updating your existing PO files.</p> </div> <div class="section" id="using-an-en-us-xpi-file"> <span id="creating-mozilla-pot-files-using-an-en-us-xpi-file"></span><h2>Using an en-US XPI file<a class="headerlink" href="#using-an-en-us-xpi-file" title="Permalink to this headline">¶</a></h2> <p>Download an XPI file and run the following:</p> <div class="highlight-python"><pre>moz2po -P en-US.xpi pot</pre> </div> <p>You now have a set of POT files in <tt class="docutils literal"><span class="pre">pot</span></tt>.</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>