36
37
<th width="100%" align="center">GLib Reference Manual</th>
37
38
<td><a accesskey="n" href="glib-Date-and-Time-Functions.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
39
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id3088091" class="shortcut">Top</a>
41
<a href="#id3088217" class="shortcut">Description</a></nobr></td></tr>
40
<tr><td colspan="5" class="shortcuts">
41
<a href="#glib-I18N.synopsis" class="shortcut">Top</a>
43
<a href="#glib-I18N.description" class="shortcut">Description</a>
43
46
<div class="refentry" lang="en">
44
47
<a name="glib-I18N"></a><div class="titlepage"></div>
45
48
<div class="refnamediv"><table width="100%"><tr>
48
<a name="id3088091"></a><span class="refentrytitle">Internationalization</span>
50
<p>Internationalization — gettext support macros</p>
50
<h2><span class="refentrytitle"><a name="glib-I18N.top_of_page"></a>Internationalization</span></h2>
51
<p>Internationalization — gettext support macros</p>
52
53
<td valign="top" align="right"></td>
53
54
</tr></table></div>
54
55
<div class="refsynopsisdiv">
56
<a name="glib-I18N.synopsis"></a><h2>Synopsis</h2>
56
57
<pre class="synopsis">
58
59
#include <glib.h>
59
60
#include <glib/gi18n.h>
62
#define <a class="link" href="glib-I18N.html#Q-:CAPS">Q_</a> (String)
63
#define <a class="link" href="glib-I18N.html#C-:CAPS">C_</a> (Context,String)
64
#define <a class="link" href="glib-I18N.html#N-:CAPS">N_</a> (String)
65
const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a>* <a class="link" href="glib-I18N.html#g-strip-context">g_strip_context</a> (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *msgid,
66
const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *msgval);
67
const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a>* <a class="link" href="glib-I18N.html#g-dpgettext">g_dpgettext</a> (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *domain,
68
const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *msgctxtid,
69
<a class="link" href="glib-Basic-Types.html#gsize">gsize</a> msgidoffset);
71
const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a>* const * <a class="link" href="glib-I18N.html#g-get-language-names">g_get_language_names</a> (void);
62
#define <a class="link" href="glib-I18N.html#Q---CAPS" title="Q_()">Q_</a> (String)
63
#define <a class="link" href="glib-I18N.html#C---CAPS" title="C_()">C_</a> (Context,String)
64
#define <a class="link" href="glib-I18N.html#N---CAPS" title="N_()">N_</a> (String)
65
#define <a class="link" href="glib-I18N.html#NC---CAPS" title="NC_()">NC_</a> (Context, String)
66
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> * <a class="link" href="glib-I18N.html#g-dgettext" title="g_dgettext ()">g_dgettext</a> (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *domain,
67
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *msgid);
68
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> * <a class="link" href="glib-I18N.html#g-dngettext" title="g_dngettext ()">g_dngettext</a> (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *domain,
69
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *msgid,
70
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *msgid_plural,
71
<a class="link" href="glib-Basic-Types.html#gulong" title="gulong">gulong</a> n);
72
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> * <a class="link" href="glib-I18N.html#g-dpgettext" title="g_dpgettext ()">g_dpgettext</a> (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *domain,
73
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *msgctxtid,
74
<a class="link" href="glib-Basic-Types.html#gsize" title="gsize">gsize</a> msgidoffset);
75
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> * <a class="link" href="glib-I18N.html#g-dpgettext2" title="g_dpgettext2 ()">g_dpgettext2</a> (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *domain,
76
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *context,
77
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *msgid);
78
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> * <a class="link" href="glib-I18N.html#g-strip-context" title="g_strip_context ()">g_strip_context</a> (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *msgid,
79
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *msgval);
81
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a>* const * <a class="link" href="glib-I18N.html#g-get-language-names" title="g_get_language_names ()">g_get_language_names</a> (void);
74
84
<div class="refsect1" lang="en">
75
<a name="id3088217"></a><h2>Description</h2>
85
<a name="glib-I18N.description"></a><h2>Description</h2>
77
87
GLib doesn't force any particular localization method upon its users.
78
But since GLib itself is localized using the <code class="function">gettext()</code> mechanism, it seems
79
natural to offer the de-facto standard <code class="function">gettext()</code> support macros in an
88
But since GLib itself is localized using the <a
89
href="/usr/share/gtk-doc/html/camel/camel-camel-i18n.html#gettext"
90
><code class="function">gettext()</code></a> mechanism, it seems
91
natural to offer the de-facto standard <a
92
href="/usr/share/gtk-doc/html/camel/camel-camel-i18n.html#gettext"
93
><code class="function">gettext()</code></a> support macros in an
83
In order to use these macros in an application, you must include
97
In order to use these macros in an application, you must include
84
98
<code class="filename">glib/gi18n.h</code>. For use in a library, must include
85
99
<code class="filename">glib/gi18n-lib.h</code> <span class="emphasis"><em>after</em></span> defining
86
100
the GETTEXT_PACKAGE macro suitably for your library:
97
111
<div class="refsect1" lang="en">
98
<a name="id3088289"></a><h2>Details</h2>
112
<a name="glib-I18N.details"></a><h2>Details</h2>
99
113
<div class="refsect2" lang="en">
100
<a name="id3088299"></a><h3>
101
<a name="Q-:CAPS"></a>Q_()</h3>
102
<a class="indexterm" name="id3088314"></a><pre class="programlisting">#define Q_(String)</pre>
114
<a name="Q---CAPS"></a><h3>Q_()</h3>
115
<pre class="programlisting">#define Q_(String)</pre>
104
Like <code class="function">_()</code>, but handles context in message ids. This has the advantage that
105
the string can be adorned with a prefix to guarantee uniqueness and provide
106
context to the translator.
118
href="/usr/share/gtk-doc/html/camel/camel-camel-i18n.html#gettext-macro"
119
><code class="function">_()</code></a>, but handles context in message ids. This has the advantage that
120
the string can be adorned with a prefix to guarantee uniqueness and provide
121
context to the translator.
109
One use case given in the gettext manual is GUI translation, where one could
110
e.g. disambiguate two "Open" menu entries as "File|Open" and "Printer|Open".
124
One use case given in the gettext manual is GUI translation, where one could
125
e.g. disambiguate two "Open" menu entries as "File|Open" and "Printer|Open".
111
126
Another use case is the string "Russian" which may have to be translated
112
differently depending on whether it's the name of a character set or a
113
language. This could be solved by using "charset|Russian" and
127
differently depending on whether it's the name of a character set or a
128
language. This could be solved by using "charset|Russian" and
114
129
"language|Russian".
117
See the <a class="link" href="glib-I18N.html#C-:CAPS"><code class="function">C_()</code></a> macro for a different way to mark up translatable strings
132
See the <a class="link" href="glib-I18N.html#C---CAPS" title="C_()"><code class="function">C_()</code></a> macro for a different way to mark up translatable strings
120
135
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
121
136
<h3 class="title">Note</h3>
123
If you are using the <a class="link" href="glib-I18N.html#Q-:CAPS"><code class="function">Q_()</code></a> macro, you need to make sure that you
138
If you are using the <a class="link" href="glib-I18N.html#Q---CAPS" title="Q_()"><code class="function">Q_()</code></a> macro, you need to make sure that you
124
139
pass <code class="option">--keyword=Q_</code> to xgettext when extracting messages.
125
140
If you are using GNU gettext >= 0.15, you can also use
126
141
<code class="option">--keyword=Q_:1g</code> to let xgettext split the context
131
146
<col align="left" valign="top">
134
<td><p><span class="term"><em class="parameter"><code>String</code></em> :</span></p></td>
149
<td><p><span class="term"><em class="parameter"><code>String</code></em> :</span></p></td>
135
150
<td>the string to be translated, with a '|'-separated prefix which
136
151
must not be translated
140
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
155
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
141
156
<td>the translated message
146
<p class="since">Since 2.4
161
<p class="since">Since 2.4</p>
152
164
<div class="refsect2" lang="en">
153
<a name="id3088432"></a><h3>
154
<a name="C-:CAPS"></a>C_()</h3>
155
<a class="indexterm" name="id3088446"></a><pre class="programlisting">#define C_(Context,String)</pre>
165
<a name="C---CAPS"></a><h3>C_()</h3>
166
<pre class="programlisting">#define C_(Context,String)</pre>
157
Uses gettext to get the translation for <em class="parameter"><code>msgid</code></em>. <em class="parameter"><code>msgctxt</code></em> is
158
used as a context. This is mainly useful for short strings which
159
may need different translations, depending on the context in which
168
Uses gettext to get the translation for <em class="parameter"><code>msgid</code></em>. <em class="parameter"><code>msgctxt</code></em> is
169
used as a context. This is mainly useful for short strings which
170
may need different translations, depending on the context in which
162
173
<div class="informalexample"><pre class="programlisting">
163
174
label1 = C_("Navigation", "Back");
164
175
label2 = C_("Body part", "Back");
168
179
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
169
180
<h3 class="title">Note</h3>
171
If you are using the <a class="link" href="glib-I18N.html#C-:CAPS"><code class="function">C_()</code></a> macro, you need to make sure that you
172
pass <code class="option">--keyword=C_:1c,2</code> to xgettext when extracting
173
messages. Note that this only works with GNU gettext >= 0.15.
182
If you are using the <a class="link" href="glib-I18N.html#C---CAPS" title="C_()"><code class="function">C_()</code></a> macro, you need to make sure that you
183
pass <code class="option">--keyword=C_:1c,2</code> to xgettext when extracting
184
messages. Note that this only works with GNU gettext >= 0.15.
176
187
<div class="variablelist"><table border="0">
177
188
<col align="left" valign="top">
180
<td><p><span class="term"><em class="parameter"><code>Context</code></em> :</span></p></td>
191
<td><p><span class="term"><em class="parameter"><code>Context</code></em> :</span></p></td>
181
192
<td>a message context, must be a string literal
185
<td><p><span class="term"><em class="parameter"><code>String</code></em> :</span></p></td>
196
<td><p><span class="term"><em class="parameter"><code>String</code></em> :</span></p></td>
186
197
<td>a message id, must be a string literal
190
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
201
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
191
202
<td>the translated message
196
<p class="since">Since 2.16
207
<p class="since">Since 2.16</p>
202
210
<div class="refsect2" lang="en">
203
<a name="id3088556"></a><h3>
204
<a name="N-:CAPS"></a>N_()</h3>
205
<a class="indexterm" name="id3088570"></a><pre class="programlisting">#define N_(String)</pre>
211
<a name="N---CAPS"></a><h3>N_()</h3>
212
<pre class="programlisting">#define N_(String)</pre>
207
214
Only marks a string for translation.
208
215
This is useful in situations where the translated strings can't
209
be directly used, e.g. in string array initializers.
210
To get the translated string, call <code class="function">gettext()</code> at runtime.
216
be directly used, e.g. in string array initializers.
217
To get the translated string, call <a
218
href="/usr/share/gtk-doc/html/camel/camel-camel-i18n.html#gettext"
219
><code class="function">gettext()</code></a> at runtime.
212
221
<div class="informalexample"><pre class="programlisting">
227
236
<div class="variablelist"><table border="0">
228
237
<col align="left" valign="top">
230
<td><p><span class="term"><em class="parameter"><code>String</code></em> :</span></p></td>
239
<td><p><span class="term"><em class="parameter"><code>String</code></em> :</span></p></td>
231
240
<td>the string to be translated
235
<p class="since">Since 2.4
241
<div class="refsect2" lang="en">
242
<a name="id3088641"></a><h3>
243
<a name="g-strip-context"></a>g_strip_context ()</h3>
244
<a class="indexterm" name="id3088657"></a><pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a>* g_strip_context (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *msgid,
245
const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *msgval);</pre>
247
An auxiliary function for <code class="function">gettext()</code> support (see <a class="link" href="glib-I18N.html#Q-:CAPS"><code class="function">Q_()</code></a>).</p>
251
<div class="variablelist"><table border="0">
252
<col align="left" valign="top">
255
<td><p><span class="term"><em class="parameter"><code>msgid</code></em> :</span></p></td>
260
<td><p><span class="term"><em class="parameter"><code>msgval</code></em> :</span></p></td>
265
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
266
<td> <em class="parameter"><code>msgval</code></em>, unless <em class="parameter"><code>msgval</code></em> is identical to <em class="parameter"><code>msgid</code></em> and contains
267
a '|' character, in which case a pointer to the substring of msgid after
268
the first '|' character is returned.
274
<p class="since">Since 2.4
278
<div class="refsect2" lang="en">
279
<a name="id3088787"></a><h3>
280
<a name="g-dpgettext"></a>g_dpgettext ()</h3>
281
<a class="indexterm" name="id3088802"></a><pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a>* g_dpgettext (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *domain,
282
const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *msgctxtid,
283
<a class="link" href="glib-Basic-Types.html#gsize">gsize</a> msgidoffset);</pre>
285
This function is a variant of <code class="function">dgettext()</code> which supports
244
<p class="since">Since 2.4</p>
247
<div class="refsect2" lang="en">
248
<a name="NC---CAPS"></a><h3>NC_()</h3>
249
<pre class="programlisting">#define NC_(Context, String)</pre>
251
Only marks a string for translation, with context.
252
This is useful in situations where the translated strings can't
253
be directly used, e.g. in string array initializers.
254
To get the translated string, you should call <a class="link" href="glib-I18N.html#g-dpgettext2" title="g_dpgettext2 ()"><code class="function">g_dpgettext2()</code></a> at runtime.
256
<div class="informalexample"><pre class="programlisting">
258
static const char *messages[] = {
259
NC_("some context", "some very meaningful message"),
260
NC_("some context", "and another one")
265
= index > 1 ? g_dpgettext2 (NULL, "some context", "a default message") : g_dpgettext2 (NULL, "some context", messages[index]);
271
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
272
<h3 class="title">Note</h3>
274
If you are using the <a class="link" href="glib-I18N.html#NC---CAPS" title="NC_()"><code class="function">NC_()</code></a> macro, you need to make sure that you
275
pass <code class="option">--keyword=NC_:1c,2</code> to xgettext when extracting
276
messages. Note that this only works with GNU gettext >= 0.15.
277
Intltool has support for the <a class="link" href="glib-I18N.html#NC---CAPS" title="NC_()"><code class="function">NC_()</code></a> macro since version 0.40.1.
280
<div class="variablelist"><table border="0">
281
<col align="left" valign="top">
284
<td><p><span class="term"><em class="parameter"><code>Context</code></em> :</span></p></td>
285
<td>a message context, must be a string literal
289
<td><p><span class="term"><em class="parameter"><code>String</code></em> :</span></p></td>
290
<td>a message id, must be a string literal
295
<p class="since">Since 2.18</p>
298
<div class="refsect2" lang="en">
299
<a name="g-dgettext"></a><h3>g_dgettext ()</h3>
300
<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> * g_dgettext (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *domain,
301
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *msgid);</pre>
303
This function is a wrapper of <a
304
href="/usr/share/gtk-doc/html/camel/camel-camel-i18n.html#dgettext"
305
><code class="function">dgettext()</code></a> which does not translate
306
the message if the default domain as set with <a
307
href="/usr/share/gtk-doc/html/camel/camel-camel-i18n.html#textdomain"
308
><code class="function">textdomain()</code></a> has no
309
translations for the current locale.
312
The advantage of using this function over <a
313
href="/usr/share/gtk-doc/html/camel/camel-camel-i18n.html#dgettext"
314
><code class="function">dgettext()</code></a> proper is that
315
libraries using this function (like GTK+) will not use translations
316
if the application using the library does not have translations for
317
the current locale. This results in a consistent English-only
318
interface instead of one having partial translations. For this
319
feature to work, the call to <a
320
href="/usr/share/gtk-doc/html/camel/camel-camel-i18n.html#textdomain"
321
><code class="function">textdomain()</code></a> and <a class="link" href="glib-running.html#setlocale" title="Locale"><code class="function">setlocale()</code></a> should
322
precede any <a class="link" href="glib-I18N.html#g-dgettext" title="g_dgettext ()"><code class="function">g_dgettext()</code></a> invocations. For GTK+, it means calling
324
href="/usr/share/gtk-doc/html/camel/camel-camel-i18n.html#textdomain"
325
><code class="function">textdomain()</code></a> before gtk_init or its variants.
328
This function disables translations if and only if upon its first
329
call all the following conditions hold:
331
<div class="itemizedlist"><ul type="disc">
333
<em class="parameter"><code>domain</code></em> is not <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>
337
href="/usr/share/gtk-doc/html/camel/camel-camel-i18n.html#textdomain"
338
><code class="function">textdomain()</code></a> has been called to set a default text domain</li>
339
<li>there is no translations available for the default text domain
340
and the current locale</li>
341
<li>current locale is not "C" or any English locales (those
342
starting with "en_")</li>
347
Note that this behavior may not be desired for example if an application
348
has its untranslated messages in a language other than English. In those
349
cases the application should call <a
350
href="/usr/share/gtk-doc/html/camel/camel-camel-i18n.html#textdomain"
351
><code class="function">textdomain()</code></a> after initializing GTK+.
354
Applications should normally not use this function directly,
356
href="/usr/share/gtk-doc/html/camel/camel-camel-i18n.html#gettext-macro"
357
><code class="function">_()</code></a> macro for translations.</p>
360
<div class="variablelist"><table border="0">
361
<col align="left" valign="top">
364
<td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
365
<td> the translation domain to use, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a> to use
366
the domain set with <a
367
href="/usr/share/gtk-doc/html/camel/camel-camel-i18n.html#textdomain"
368
><code class="function">textdomain()</code></a>
372
<td><p><span class="term"><em class="parameter"><code>msgid</code></em> :</span></p></td>
373
<td> message to translate
377
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
378
<td> The translated string
384
<p class="since">Since 2.18</p>
387
<div class="refsect2" lang="en">
388
<a name="g-dngettext"></a><h3>g_dngettext ()</h3>
389
<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> * g_dngettext (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *domain,
390
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *msgid,
391
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *msgid_plural,
392
<a class="link" href="glib-Basic-Types.html#gulong" title="gulong">gulong</a> n);</pre>
394
This function is a wrapper of <code class="function">dngettext()</code> which does not translate
395
the message if the default domain as set with <a
396
href="/usr/share/gtk-doc/html/camel/camel-camel-i18n.html#textdomain"
397
><code class="function">textdomain()</code></a> has no
398
translations for the current locale.
401
See <a class="link" href="glib-I18N.html#g-dgettext" title="g_dgettext ()"><code class="function">g_dgettext()</code></a> for details of how this differs from <code class="function">dngettext()</code>
405
<div class="variablelist"><table border="0">
406
<col align="left" valign="top">
409
<td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
410
<td> the translation domain to use, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a> to use
411
the domain set with <a
412
href="/usr/share/gtk-doc/html/camel/camel-camel-i18n.html#textdomain"
413
><code class="function">textdomain()</code></a>
417
<td><p><span class="term"><em class="parameter"><code>msgid</code></em> :</span></p></td>
418
<td> message to translate
422
<td><p><span class="term"><em class="parameter"><code>msgid_plural</code></em> :</span></p></td>
423
<td> plural form of the message
427
<td><p><span class="term"><em class="parameter"><code>n</code></em> :</span></p></td>
428
<td> the quantity for which translation is needed
432
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
433
<td> The translated string
439
<p class="since">Since 2.18</p>
442
<div class="refsect2" lang="en">
443
<a name="g-dpgettext"></a><h3>g_dpgettext ()</h3>
444
<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> * g_dpgettext (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *domain,
445
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *msgctxtid,
446
<a class="link" href="glib-Basic-Types.html#gsize" title="gsize">gsize</a> msgidoffset);</pre>
448
This function is a variant of <a class="link" href="glib-I18N.html#g-dgettext" title="g_dgettext ()"><code class="function">g_dgettext()</code></a> which supports
286
449
a disambiguating message context. GNU gettext uses the
287
450
'\004' character to separate the message context and
288
451
message id in <em class="parameter"><code>msgctxtid</code></em>.
457
This uses <a class="link" href="glib-I18N.html#g-dgettext" title="g_dgettext ()"><code class="function">g_dgettext()</code></a> internally. See that functions for differences
459
href="/usr/share/gtk-doc/html/camel/camel-camel-i18n.html#dgettext"
460
><code class="function">dgettext()</code></a> proper.
294
463
Applications should normally not use this function directly,
295
but use the <a class="link" href="glib-I18N.html#C-:CAPS"><code class="function">C_()</code></a> macro for translations with context.</p>
464
but use the <a class="link" href="glib-I18N.html#C---CAPS" title="C_()"><code class="function">C_()</code></a> macro for translations with context.</p>
299
467
<div class="variablelist"><table border="0">
300
468
<col align="left" valign="top">
303
<td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
304
<td> the translation domain to use, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to use
305
the domain set with <code class="function">textdomain()</code>
471
<td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
472
<td> the translation domain to use, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a> to use
473
the domain set with <a
474
href="/usr/share/gtk-doc/html/camel/camel-camel-i18n.html#textdomain"
475
><code class="function">textdomain()</code></a>
309
<td><p><span class="term"><em class="parameter"><code>msgctxtid</code></em> :</span></p></td>
479
<td><p><span class="term"><em class="parameter"><code>msgctxtid</code></em> :</span></p></td>
310
480
<td> a combined message context and message id, separated
311
481
by a \004 character
315
<td><p><span class="term"><em class="parameter"><code>msgidoffset</code></em> :</span></p></td>
485
<td><p><span class="term"><em class="parameter"><code>msgidoffset</code></em> :</span></p></td>
316
486
<td> the offset of the message id in <em class="parameter"><code>msgctxid</code></em>
320
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
321
<td> The translated string
327
<p class="since">Since 2.16
331
<div class="refsect2" lang="en">
332
<a name="id3088988"></a><h3>
333
<a name="g-get-language-names"></a>g_get_language_names ()</h3>
334
<a class="indexterm" name="id3089003"></a><pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a>* const * g_get_language_names (void);</pre>
490
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
491
<td> The translated string
497
<p class="since">Since 2.16</p>
500
<div class="refsect2" lang="en">
501
<a name="g-dpgettext2"></a><h3>g_dpgettext2 ()</h3>
502
<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> * g_dpgettext2 (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *domain,
503
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *context,
504
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *msgid);</pre>
506
This function is a variant of <a class="link" href="glib-I18N.html#g-dgettext" title="g_dgettext ()"><code class="function">g_dgettext()</code></a> which supports
507
a disambiguating message context. GNU gettext uses the
508
'\004' character to separate the message context and
509
message id in <em class="parameter"><code>msgctxtid</code></em>.
512
This uses <a class="link" href="glib-I18N.html#g-dgettext" title="g_dgettext ()"><code class="function">g_dgettext()</code></a> internally. See that functions for differences
514
href="/usr/share/gtk-doc/html/camel/camel-camel-i18n.html#dgettext"
515
><code class="function">dgettext()</code></a> proper.
518
This function differs from <a class="link" href="glib-I18N.html#C---CAPS" title="C_()"><code class="function">C_()</code></a> in that it is not a macro and
519
thus you may use non-string-literals as context and msgid arguments.</p>
522
<div class="variablelist"><table border="0">
523
<col align="left" valign="top">
526
<td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
527
<td> the translation domain to use, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a> to use
528
the domain set with <a
529
href="/usr/share/gtk-doc/html/camel/camel-camel-i18n.html#textdomain"
530
><code class="function">textdomain()</code></a>
534
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
535
<td> the message context
539
<td><p><span class="term"><em class="parameter"><code>msgid</code></em> :</span></p></td>
544
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
545
<td> The translated string
551
<p class="since">Since 2.18</p>
554
<div class="refsect2" lang="en">
555
<a name="g-strip-context"></a><h3>g_strip_context ()</h3>
556
<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> * g_strip_context (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *msgid,
557
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *msgval);</pre>
559
An auxiliary function for <a
560
href="/usr/share/gtk-doc/html/camel/camel-camel-i18n.html#gettext"
561
><code class="function">gettext()</code></a> support (see <a class="link" href="glib-I18N.html#Q---CAPS" title="Q_()"><code class="function">Q_()</code></a>).</p>
564
<div class="variablelist"><table border="0">
565
<col align="left" valign="top">
568
<td><p><span class="term"><em class="parameter"><code>msgid</code></em> :</span></p></td>
573
<td><p><span class="term"><em class="parameter"><code>msgval</code></em> :</span></p></td>
578
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
579
<td> <em class="parameter"><code>msgval</code></em>, unless <em class="parameter"><code>msgval</code></em> is identical to <em class="parameter"><code>msgid</code></em> and contains
580
a '|' character, in which case a pointer to the substring of msgid after
581
the first '|' character is returned.
587
<p class="since">Since 2.4</p>
590
<div class="refsect2" lang="en">
591
<a name="g-get-language-names"></a><h3>g_get_language_names ()</h3>
592
<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a>* const * g_get_language_names (void);</pre>
336
594
Computes a list of applicable locale names, which can be used to
337
595
e.g. construct locale-dependent filenames or search paths. The returned