Sophie

Sophie

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

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>Quoting and Escaping &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="Translation Related File Formats" href="index.html" />
    <link rel="next" title="Translate Styleguide" href="../styleguide.html" />
    <link rel="prev" title="Base classes" href="base_classes.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="../guides/index.html">Use Cases</a></li>
<li class="toctree-l1"><a class="reference internal" href="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="#">Quoting and Escaping</a><ul>
<li><a class="reference internal" href="#po-format">PO format</a></li>
<li><a class="reference internal" href="#dtd-format">DTD format</a></li>
<li><a class="reference internal" href="#mozilla-properties-format">Mozilla properties format</a></li>
</ul>
</li>
</ul>
</ul>
</li>
            
            
              
  <li><a href="base_classes.html"
         title="previous chapter">&laquo; Base classes</a></li>
  <li><a href="../styleguide.html"
         title="next chapter">Translate Styleguide &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="quoting-and-escaping">
<span id="id1"></span><h1>Quoting and Escaping<a class="headerlink" href="#quoting-and-escaping" title="Permalink to this headline">¶</a></h1>
<p>Different translation <a class="reference internal" href="index.html"><em>formats</em></a> handle quoting and escaping
strings differently. This is meant to be a common page which outlines the
differences</p>
<div class="section" id="po-format">
<span id="quoting-and-escaping-po-format"></span><h2>PO format<a class="headerlink" href="#po-format" title="Permalink to this headline">¶</a></h2>
<p>Strings are quoted using double quotes. For long strings multiline quotes are
done by opening and closing the quotes on each line. Usually in this case the
first line is left blank. The splitting of strings over lines is transparent
i.e. it does not imply line breaks in the translated strings.</p>
<p>Escaping is done with a backslash. An escaped double quote (<tt class="docutils literal"><span class="pre">\&quot;</span></tt>) corresponds
to a double quote in the original string. <tt class="docutils literal"><span class="pre">\n</span></tt> for newline, <tt class="docutils literal"><span class="pre">\t</span></tt> for tabs
etc are used. Backslashes can be escaped to to give a native backslash.</p>
<p>See also <a class="reference external" href="guide/translation/escaping">escaping</a> in the translation guide.</p>
<p>Example:</p>
<div class="highlight-po"><div class="highlight"><pre><span class="nv">msgid</span> <span class="s">&quot;&quot;</span>
<span class="s">&quot;This is a long string with a \n newline, a \&quot; double quote, and a \\ backslash.&quot;</span>
<span class="s">&quot;There is no space between the . at the end of the last sentence &quot;</span>
<span class="s">&quot;and the T at the beginning of this one.&quot;</span>
</pre></div>
</div>
</div>
<div class="section" id="dtd-format">
<span id="quoting-and-escaping-dtd-format"></span><h2>DTD format<a class="headerlink" href="#dtd-format" title="Permalink to this headline">¶</a></h2>
<p>Strings are quoted using either double or single quotes. The quoting character
may not occur within the string. There is no provision for escaping. XML
entities can be used e.g. <tt class="docutils literal"><span class="pre">&amp;apos;</span></tt> can be used to denote a single quote
within the single-quoted string.</p>
<p>Some DTD files seem to have backslash-escapes, but these are anomalies: see
<a class="reference external" href="http://groups.google.com/group/mozilla.dev.l10n/browse_thread/thread/58256c1f59c22798/b4bac2de4182f3e0">discussion thread on Mozilla l10n-dev</a></p>
</div>
<div class="section" id="mozilla-properties-format">
<span id="quoting-and-escaping-mozilla-properties-format"></span><h2>Mozilla properties format<a class="headerlink" href="#mozilla-properties-format" title="Permalink to this headline">¶</a></h2>
<p>Note that this section does not describe the Java properties files, even though
they are quite similar.</p>
<p>It seems that the literal string <tt class="docutils literal"><span class="pre">\n</span></tt> (a backslash followed by the character
&#8216;n&#8217;) and <tt class="docutils literal"><span class="pre">\t</span></tt> and <tt class="docutils literal"><span class="pre">\r</span></tt> can not be encoded in properties files. This is the
assumption of the toolkit.</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>