File: libglade-i18n.html

package info (click to toggle)
libglade2 1%3A2.4.2-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,148 kB
  • ctags: 461
  • sloc: sh: 8,376; ansic: 4,260; xml: 1,764; makefile: 116
file content (22 lines) | stat: -rw-r--r-- 3,523 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Internationalisation with Libglade</title><meta name="generator" content="DocBook XSL Stylesheets V1.66.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.3 (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="PartI.Libglade Library Reference"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" 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
      <i class="parameter"><tt>translatable</tt></i> property of the
      <tt class="sgmltag-element">&lt;property&gt;</tt> element:</p><pre class="programlisting">
&lt;widget class="GtkLabel" id="label1"&gt;
  &lt;property name="label" translatable="yes"&gt;Foo&lt;/property&gt;
  ...
&lt;/widget&gt;
</pre><p>Libglade will translate marked properties using the
      translation domain specified in the
      <tt class="function">glade_xml_new()</tt> (or the default domain if
      <tt class="constant">NULL</tt>).</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 <i class="parameter"><tt>context</tt></i> 
      attribute of the <tt class="sgmltag-element">&lt;property&gt;</tt> 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><b class="command">intltool</b></span>. (XXXX - does this actually work
      yet?).</p></div><table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="libglade-modules.html"><b>&lt;&lt;Libglade Modules</b></a></td><td align="right"><a accesskey="n" href="libglade-extending.html"><b>Extending Libglade&gt;&gt;</b></a></td></tr></table></body></html>