/usr/share/gtk-doc/html/pygtk/class-pangolanguage.html is in python-gtk2-doc 2.24.0-4ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>pango.Language</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="pango-class-reference.html" title="The pango Class Reference"><link rel="prev" href="class-pangoglyphstring.html" title="pango.GlyphString"><link rel="next" href="class-pangolayout.html" title="pango.Layout"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">pango.Language</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-pangoglyphstring.html">Prev</a> </td><th width="60%" align="center">The pango Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-pangolayout.html">Next</a></td></tr></table><hr></div><div class="refentry" title="pango.Language"><a name="class-pangolanguage"></a><div class="titlepage"></div><div class="refnamediv"><h2>pango.Language</h2><p>pango.Language — an object that represents a language tag.</p></div><div class="refsect1" title="Synopsis"><a name="id3487432"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">pango.Language</span></span>(<span class="ooclass"><span class="classname">gobject.GBoxed</span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a class="link" href="class-pangolanguage.html#constructor-pangolanguage" title="Constructor">pango.Language</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>language</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolanguage.html#method-pangolanguage--matches" title="pango.Language.matches">matches</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>range_list</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolanguage.html#method-pangolanguage--to-string" title="pango.Language.matches">to_string</a></span>(<span class="methodparam"></span>)</code><br></pre></td></tr></table><pre class="programlisting">
<span class="bold"><strong>Functions</strong></span>
<code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolanguage.html#function-pango--pango-language-from-string" title="pango.pango_language_from_string">pango.pango_language_from_string</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>language</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-pangolanguage.html#function-pango--pango-language-matches" title="pango.pango_language_matches">pango.pango_language_matches</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>language</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>range_list</code></strong></span></span>)</code></pre></div><div class="refsect1" title="Description"><a name="id3416852"></a><h2>Description</h2><p>A <a class="link" href="class-pangolanguage.html" title="pango.Language"><code class="classname">pango.Language</code></a>
object represents a language tag meeting the RFC-3066 standard. The <a class="link" href="class-pangolanguage.html" title="pango.Language"><code class="classname">pango.Language</code></a>
can be retrieved from a <a class="link" href="class-pangocontext.html" title="pango.Context"><code class="classname">pango.Context</code></a> by
using the <a class="link" href="class-pangocontext.html#method-pangocontext--get-language" title="pango.Context.get_language"><code class="methodname">pango.Context.get_language</code>()</a>
method or created using the <a class="link" href="class-pangolanguage.html#constructor-pangolanguage" title="Constructor">pango.Language</a>() constructor.
Example RFC-3066 language tags include: "en-us", "fr", and
"sgn-us-ma".</p></div><div class="refsect1" title="Constructor"><a name="constructor-pangolanguage"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">pango.Language</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>language</code></strong></span>></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>language</code></strong> :</span></p></td><td>a string representing a language
tag</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a new <a class="link" href="class-pangolanguage.html" title="pango.Language"><code class="classname">pango.Language</code></a>
object</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This constructor is available in PyGTK 2.4 and above.</p></div><p>Creates a new <a class="link" href="class-pangolanguage.html" title="pango.Language"><code class="classname">pango.Language</code></a>
object from the RFC-3066 language tag specified by
<em class="parameter"><code>language</code></em>. This constructor first canonicalizes the
string in <em class="parameter"><code>language</code></em> by converting it to lowercase,
mapping '_' to '-', and stripping all characters other than letters and
'-'.</p></div><div class="refsect1" title="Methods"><a name="id3278935"></a><h2>Methods</h2><div class="refsect2" title="pango.Language.matches"><a name="method-pangolanguage--matches"></a><h3>pango.Language.matches</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">matches</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>range_list</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>>range_list</code></strong> :</span></p></td><td>a list of language ranges, separated by ';'
characters.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if a match was
found.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">matches</code>() method returns
<code class="literal">True</code> if the language matches one of the language ranges
in the list specified by <em class="parameter"><code>range_list</code></em>.A language tag is
considered to match a range in the list if</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">the range is '*'</li><li class="listitem">the range is exactly the same as the tag, or</li><li class="listitem">the range is a prefix of the tag, and the character after
the matching portion of the tag is '-'</li></ul></div><p>each range must either be '*', or a canonicalized RFC-3066
language range (see the <a class="link" href="class-pangolanguage.html#constructor-pangolanguage" title="Constructor">pango.Language</a>() constructor for
more information).</p></div><div class="refsect2" title="pango.Language.matches"><a name="method-pangolanguage--to-string"></a><h3>pango.Language.matches</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">to_string</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the string representation of the language
tag</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">to_string</code>() method returns a string
representation of the canonicalized language tag. See the <a class="link" href="class-pangolanguage.html#constructor-pangolanguage" title="Constructor">pango.Language</a>() constructor for
more information.</p></div></div><div class="refsect1" title="Functions"><a name="id2892312"></a><h2>Functions</h2><div class="refsect2" title="pango.pango_language_from_string"><a name="function-pango--pango-language-from-string"></a><h3>pango.pango_language_from_string</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">pango.pango_language_from_string</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>language</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>language</code></strong> :</span></p></td><td>a string representing a language
tag</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a new <a class="link" href="class-pangolanguage.html" title="pango.Language"><code class="classname">pango.Language</code></a>
object</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This function is deprecated in PyGTK 2.4 and above. Use the
<a class="link" href="class-pangolanguage.html#constructor-pangolanguage" title="Constructor">pango.Language()</a>
constructor instead.</p></div><p>The <code class="function">pango.pango_language_from_string</code>()
function takes a RFC-3066 format language tag as a string (specified by
<em class="parameter"><code>language</code></em>) and converts it to a <a class="link" href="class-pangolanguage.html" title="pango.Language"><code class="classname">pango.Language</code></a>
object. This function first canonicalizes the string by converting it to
lowercase, mapping '_' to '-', and stripping all characters other than
letters and '-'.</p></div><div class="refsect2" title="pango.pango_language_matches"><a name="function-pango--pango-language-matches"></a><h3>pango.pango_language_matches</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">pango.pango_language_matches</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code></code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>language</code></strong> :</span></p></td><td> a language tag (see the <a class="link" href="class-pangolanguage.html#function-pango--pango-language-from-string" title="pango.pango_language_from_string"><code class="function">pango.pango_language_from_string</code>()</a>
function), <code class="literal">None</code> is allowed and matches nothing
but '*'</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>range_list</code></strong> :</span></p></td><td> a list of language ranges, separated by ';'
characters. each element must either be '*', or a RFC 3066
language range canonicalized as by the <a class="link" href="class-pangolanguage.html#function-pango--pango-language-from-string" title="pango.pango_language_from_string"><code class="function">pango.pango_language_from_string</code>()</a>
function.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if a match was
found.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This function is deprecated in PyGTK 2.4 and above. Use the
<a class="link" href="class-pangolanguage.html#method-pangolanguage--matches" title="pango.Language.matches"><code class="methodname">matches</code>()</a>
method instead.</p></div><p>The <code class="function">pango.pango_language_matches</code>() function
checks if a language tag matches one of the elements in a list of language
ranges. A language tag is considered to match a range in the list if the
range is '*', the range is exactly the tag, or the range is a prefix of the
tag, and the character after the tag is '-'.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-pangoglyphstring.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="pango-class-reference.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="class-pangolayout.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">pango.GlyphString </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> pango.Layout</td></tr></table></div></body></html>
|