123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
-
- <!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>Translation — searx 0.12.0 documentation</title>
- <link rel="stylesheet" href="../_static/style.css" type="text/css" />
- <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: '../',
- VERSION: '0.12.0',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true,
- SOURCELINK_SUFFIX: '.txt'
- };
- </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>
- <link rel="index" title="Index" href="../genindex.html" />
- <link rel="search" title="Search" href="../search.html" />
- <link rel="prev" title="Plugins" href="plugins.html" />
-
-
- <link media="only screen and (max-device-width: 480px)" href="../_static/small_flask.css" type= "text/css" rel="stylesheet" />
- <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
-
- </head>
- <body>
-
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <div class="section" id="translation">
- <h1>Translation<a class="headerlink" href="#translation" title="Permalink to this headline">¶</a></h1>
- <div class="section" id="requirements">
- <h2>Requirements<a class="headerlink" href="#requirements" title="Permalink to this headline">¶</a></h2>
- <blockquote>
- <div><ul class="simple">
- <li>Transifex account</li>
- <li>Installed CLI tool of Transifex</li>
- </ul>
- </div></blockquote>
- </div>
- <div class="section" id="init-transifex-project">
- <h2>Init Transifex project<a class="headerlink" href="#init-transifex-project" title="Permalink to this headline">¶</a></h2>
- <p>After installing <code class="docutils literal"><span class="pre">transifex</span></code> using pip, run the following command to initialize the project.</p>
- <div class="code shell highlight-default"><div class="highlight"><pre><span></span><span class="n">tx</span> <span class="n">init</span> <span class="c1"># Transifex instance: https://www.transifex.com/asciimoo/searx/</span>
- </pre></div>
- </div>
- <p>After <code class="docutils literal"><span class="pre">$HOME/.transifexrc</span></code> is created, get a Transifex API key and insert it into the configuration file.</p>
- <p>Create a configuration file for <code class="docutils literal"><span class="pre">tx</span></code> named <code class="docutils literal"><span class="pre">$HOME/.tx/config</span></code>.</p>
- <div class="code shell highlight-default"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">main</span><span class="p">]</span>
- <span class="n">host</span> <span class="o">=</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">www</span><span class="o">.</span><span class="n">transifex</span><span class="o">.</span><span class="n">com</span>
- <span class="p">[</span><span class="n">searx</span><span class="o">.</span><span class="n">messagespo</span><span class="p">]</span>
- <span class="n">file_filter</span> <span class="o">=</span> <span class="n">searx</span><span class="o">/</span><span class="n">translations</span><span class="o">/<</span><span class="n">lang</span><span class="o">>/</span><span class="n">LC_MESSAGES</span><span class="o">/</span><span class="n">messages</span><span class="o">.</span><span class="n">po</span>
- <span class="n">source_file</span> <span class="o">=</span> <span class="n">messages</span><span class="o">.</span><span class="n">pot</span>
- <span class="n">source_lang</span> <span class="o">=</span> <span class="n">en</span>
- <span class="nb">type</span> <span class="o">=</span> <span class="n">PO</span>
- </pre></div>
- </div>
- <p>Then run <code class="docutils literal"><span class="pre">tx</span> <span class="pre">set</span></code>:</p>
- <div class="code shell highlight-default"><div class="highlight"><pre><span></span><span class="n">tx</span> <span class="nb">set</span> <span class="o">--</span><span class="n">auto</span><span class="o">-</span><span class="n">local</span> <span class="o">-</span><span class="n">r</span> <span class="n">searx</span><span class="o">.</span><span class="n">messagespo</span> <span class="s1">'searx/translations/<lang>/LC_MESSAGES/messages.po'</span> \
- <span class="o">--</span><span class="n">source</span><span class="o">-</span><span class="n">lang</span> <span class="n">en</span> <span class="o">--</span><span class="nb">type</span> <span class="n">PO</span> <span class="o">--</span><span class="n">source</span><span class="o">-</span><span class="n">file</span> <span class="n">messages</span><span class="o">.</span><span class="n">pot</span> <span class="o">--</span><span class="n">execute</span>
- </pre></div>
- </div>
- </div>
- <div class="section" id="update-translations">
- <h2>Update translations<a class="headerlink" href="#update-translations" title="Permalink to this headline">¶</a></h2>
- <p>To retrieve the latest translations, pull it from Transifex.</p>
- <div class="code shell highlight-default"><div class="highlight"><pre><span></span><span class="n">tx</span> <span class="n">pull</span> <span class="o">-</span><span class="n">a</span>
- </pre></div>
- </div>
- <p>Then check the new languages. If strings translated are not enough, delete those folders, because
- those should not be compiled. Call the command below to compile the <code class="docutils literal"><span class="pre">.po</span></code> files.</p>
- <div class="code shell highlight-default"><div class="highlight"><pre><span></span><span class="n">pybabel</span> <span class="nb">compile</span> <span class="o">-</span><span class="n">d</span> <span class="n">searx</span><span class="o">/</span><span class="n">translations</span>
- </pre></div>
- </div>
- <p>After the compilation is finished commit the <code class="docutils literal"><span class="pre">.po</span></code> and <code class="docutils literal"><span class="pre">.mo</span></code> files and create a PR.</p>
- </div>
- </div>
-
-
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper"><div class="sidebar_container body">
- <h1>Searx</h1>
- <ul>
- <li><a href="../index.html">Home</a></li>
- <li><a href="https://github.com/asciimoo/searx">Source</a></li>
- <li><a href="../blog/blog.html">Blog</a></li>
- <li><a href="https://github.com/asciimoo/searx/wiki">Wiki</a></li>
- <li><a href="https://github.com/asciimoo/searx/wiki/Searx-instances">Public instances</a></li>
- </ul>
- <hr />
- <ul>
- <li><a href="https://twitter.com/Searx_engine">Twitter</a></li>
- </ul>
- </div>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="footer">
- © Copyright 2015-2017, Adam Tauber.
- </div>
- </body>
- </html>
|