|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /usr/share/gtk-doc/html/libglade/ |
Upload File : |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Internationalisation with Libglade</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
<link rel="start" href="index.html" title="Libglade Reference Manual">
<link rel="up" href="libglade-notes.html" title="Libglade Programming Notes">
<link rel="prev" href="libglade-modules.html" title="Libglade Modules">
<link rel="next" href="libglade-extending.html" title="Extending Libglade">
<meta name="generator" content="GTK-Doc V1.6 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="libglade-notes.html" title="Libglade Programming Notes">
<link rel="chapter" href="libglade-dtd.html" title="Glade 2.0 File Format">
<link rel="part" href="libglade-lib.html" title="Part I. Libglade Library Reference">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
<td><a accesskey="p" href="libglade-modules.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="libglade-notes.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">Libglade Reference Manual</th>
<td><a accesskey="n" href="libglade-extending.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr></table>
<div class="sect1" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="libglade-i18n"></a>Internationalisation with Libglade</h2></div></div></div>
<p>Glade files mark properties for translation with the
<em class="parameter"><code>translatable</code></em> property of the
<code class="sgmltag-element"><property></code> element:</p>
<pre class="programlisting">
<widget class="GtkLabel" id="label1">
<property name="label" translatable="yes">Foo</property>
...
</widget>
</pre>
<p>Libglade will translate marked properties using the
translation domain specified in the
<code class="function">glade_xml_new()</code> (or the default domain if
<code class="constant">NULL</code>).</p>
<p>Libglade also supports disambiguating properties by
prefixing them with a |-separated context string, e.g.
"Menu/Printer|Open" vs. "Menu/File|Open". You must tell Libglade that
the property has a prefix by setting the <em class="parameter"><code>context</code></em>
attribute of the <code class="sgmltag-element"><property></code> element to "yes".
To learn more about this technique, read the chapter "How to use
gettext in GUI programs" in the gettext manual, and see the GLib
API documentation for g_strip_context().
</p>
<p>To add the strings found in a glade file to your
translation catalog template through the use of
<span><strong class="command">intltool</strong></span>. (XXXX - does this actually work
yet?).</p>
</div>
</body>
</html>