58
58
<div class="refsynopsisdiv" title="Synopsis">
59
59
<a name="glib-I18N.synopsis"></a><h2>Synopsis</h2>
60
60
<pre class="synopsis">
62
61
#include <glib.h>
63
62
#include <glib/gi18n.h>
65
#define <a class="link" href="glib-I18N.html#Q---CAPS" title="Q_()">Q_</a> (String)
66
#define <a class="link" href="glib-I18N.html#C---CAPS" title="C_()">C_</a> (Context,String)
67
#define <a class="link" href="glib-I18N.html#N---CAPS" title="N_()">N_</a> (String)
68
#define <a class="link" href="glib-I18N.html#NC---CAPS" title="NC_()">NC_</a> (Context, String)
69
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,
70
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *msgid);
71
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,
72
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *msgid,
73
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *msgid_plural,
74
<a class="link" href="glib-Basic-Types.html#gulong" title="gulong">gulong</a> n);
75
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,
76
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *msgctxtid,
77
<a class="link" href="glib-Basic-Types.html#gsize" title="gsize">gsize</a> msgidoffset);
78
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,
79
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *context,
80
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *msgid);
81
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,
82
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *msgval);
64
#define <a class="link" href="glib-I18N.html#Q-:CAPS" title="Q_()">Q_</a> (String)
65
#define <a class="link" href="glib-I18N.html#C-:CAPS" title="C_()">C_</a> (Context,String)
66
#define <a class="link" href="glib-I18N.html#N-:CAPS" title="N_()">N_</a> (String)
67
#define <a class="link" href="glib-I18N.html#NC-:CAPS" title="NC_()">NC_</a> (Context, String)
68
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></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"><span class="returnvalue">gchar</span></a> *domain,
69
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *msgid);
70
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></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"><span class="returnvalue">gchar</span></a> *domain,
71
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *msgid,
72
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *msgid_plural,
73
<a class="link" href="glib-Basic-Types.html#gulong" title="gulong"><span class="returnvalue">gulong</span></a> n);
74
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></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"><span class="returnvalue">gchar</span></a> *domain,
75
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *msgctxtid,
76
<a class="link" href="glib-Basic-Types.html#gsize" title="gsize"><span class="returnvalue">gsize</span></a> msgidoffset);
77
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></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"><span class="returnvalue">gchar</span></a> *domain,
78
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *context,
79
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *msgid);
80
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></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"><span class="returnvalue">gchar</span></a> *msgid,
81
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *msgval);
84
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);
83
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a>* const * <a class="link" href="glib-I18N.html#g-get-language-names" title="g_get_language_names ()">g_get_language_names</a> (void);
87
86
<div class="refsect1" title="Description">
98
97
<code class="filename">glib/gi18n-lib.h</code> <span class="emphasis"><em>after</em></span> defining
99
98
the GETTEXT_PACKAGE macro suitably for your library:
101
<div class="informalexample"><pre class="programlisting">
102
#define GETTEXT_PACKAGE "gtk20"
103
#include <glib/gi18n-lib.h>
100
<div class="informalexample">
101
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
104
<td class="listing_lines" align="right"><pre>1
106
<td class="listing_code"><pre class="programlisting"><span class="preproc">#define</span><span class="normal"> GETTEXT_PACKAGE </span><span class="string">"gtk20"</span>
107
<span class="preproc">#include</span><span class="normal"> </span><span class="string"><glib/gi18n-lib.h></span></pre></td>
106
114
The gettext manual covers details of how to set up message extraction
126
134
"language|Russian".
129
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
137
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
132
140
<div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
133
141
<h3 class="title">Note</h3>
135
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
143
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
136
144
pass <code class="option">--keyword=Q_</code> to xgettext when extracting messages.
137
145
If you are using GNU gettext >= 0.15, you can also use
138
146
<code class="option">--keyword=Q_:1g</code> to let xgettext split the context
167
175
may need different translations, depending on the context in which
170
<div class="informalexample"><pre class="programlisting">
171
label1 = C_("Navigation", "Back");
172
label2 = C_("Body part", "Back");
178
<div class="informalexample">
179
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
182
<td class="listing_lines" align="right"><pre>1
184
<td class="listing_code"><pre class="programlisting"><span class="normal">label1 </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="glib-I18N.html#C-:CAPS">C_</a></span><span class="symbol">(</span><span class="string">"Navigation"</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Back"</span><span class="symbol">);</span>
185
<span class="normal">label2 </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="glib-I18N.html#C-:CAPS">C_</a></span><span class="symbol">(</span><span class="string">"Body part"</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Back"</span><span class="symbol">);</span></pre></td>
176
193
<div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
177
194
<h3 class="title">Note</h3>
179
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
196
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
180
197
pass <code class="option">--keyword=C_:1c,2</code> to xgettext when extracting
181
198
messages. Note that this only works with GNU gettext >= 0.15.
213
230
be directly used, e.g. in string array initializers.
214
231
To get the translated string, call <code class="function">gettext()</code> at runtime.
216
<div class="informalexample"><pre class="programlisting">
218
static const char *messages[] = {
219
N_("some very meaningful message"),
220
N_("and another one")
225
= index > 1 ? _("a default message") : gettext (messages[index]);
233
<div class="informalexample">
234
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
237
<td class="listing_lines" align="right"><pre>1
250
<td class="listing_code"><pre class="programlisting"><span class="cbracket">{</span>
251
<span class="normal"> </span><span class="keyword">static</span><span class="normal"> </span><span class="keyword">const</span><span class="normal"> </span><span class="type">char</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">messages</span><span class="symbol">[]</span><span class="normal"> </span><span class="symbol">=</span><span class="normal"> </span><span class="cbracket">{</span>
252
<span class="normal"> </span><span class="function"><a href="glib-I18N.html#N-:CAPS">N_</a></span><span class="symbol">(</span><span class="string">"some very meaningful message"</span><span class="symbol">),</span>
253
<span class="normal"> </span><span class="function"><a href="glib-I18N.html#N-:CAPS">N_</a></span><span class="symbol">(</span><span class="string">"and another one"</span><span class="symbol">)</span>
254
<span class="normal"> </span><span class="cbracket">}</span><span class="symbol">;</span>
255
<span class="normal"> </span><span class="keyword">const</span><span class="normal"> </span><span class="type">char</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">string</span><span class="symbol">;</span>
256
<span class="normal"> </span><span class="symbol">...</span>
257
<span class="normal"> string</span>
258
<span class="normal"> </span><span class="symbol">=</span><span class="normal"> index </span><span class="symbol">></span><span class="normal"> </span><span class="number">1</span><span class="normal"> </span><span class="symbol">?</span><span class="normal"> </span><span class="function">_</span><span class="symbol">(</span><span class="string">"a default message"</span><span class="symbol">)</span><span class="normal"> </span><span class="symbol">:</span><span class="normal"> </span><span class="function">gettext</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">messages</span><span class="symbol">[</span><span class="normal">index</span><span class="symbol">]);</span>
260
<span class="normal"> </span><span class="function">fputs</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">string</span><span class="symbol">);</span>
261
<span class="normal"> </span><span class="symbol">...</span>
262
<span class="cbracket">}</span></pre></td>
231
268
<div class="variablelist"><table border="0">
232
269
<col align="left" valign="top">
248
285
be directly used, e.g. in string array initializers.
249
286
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.
251
<div class="informalexample"><pre class="programlisting">
253
static const char *messages[] = {
254
NC_("some context", "some very meaningful message"),
255
NC_("some context", "and another one")
260
= index > 1 ? g_dpgettext2 (NULL, "some context", "a default message") : g_dpgettext2 (NULL, "some context", messages[index]);
288
<div class="informalexample">
289
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
292
<td class="listing_lines" align="right"><pre>1
305
<td class="listing_code"><pre class="programlisting"><span class="cbracket">{</span>
306
<span class="normal"> </span><span class="keyword">static</span><span class="normal"> </span><span class="keyword">const</span><span class="normal"> </span><span class="type">char</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">messages</span><span class="symbol">[]</span><span class="normal"> </span><span class="symbol">=</span><span class="normal"> </span><span class="cbracket">{</span>
307
<span class="normal"> </span><span class="function"><a href="glib-I18N.html#NC-:CAPS">NC_</a></span><span class="symbol">(</span><span class="string">"some context"</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"some very meaningful message"</span><span class="symbol">),</span>
308
<span class="normal"> </span><span class="function"><a href="glib-I18N.html#NC-:CAPS">NC_</a></span><span class="symbol">(</span><span class="string">"some context"</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"and another one"</span><span class="symbol">)</span>
309
<span class="normal"> </span><span class="cbracket">}</span><span class="symbol">;</span>
310
<span class="normal"> </span><span class="keyword">const</span><span class="normal"> </span><span class="type">char</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">string</span><span class="symbol">;</span>
311
<span class="normal"> </span><span class="symbol">...</span>
312
<span class="normal"> string</span>
313
<span class="normal"> </span><span class="symbol">=</span><span class="normal"> index </span><span class="symbol">></span><span class="normal"> </span><span class="number">1</span><span class="normal"> </span><span class="symbol">?</span><span class="normal"> </span><span class="function"><a href="glib-I18N.html#g-dpgettext2">g_dpgettext2</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">,</span><span class="normal"> </span><span class="string">"some context"</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"a default message"</span><span class="symbol">)</span><span class="normal"> </span><span class="symbol">:</span><span class="normal"> </span><span class="function"><a href="glib-I18N.html#g-dpgettext2">g_dpgettext2</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">,</span><span class="normal"> </span><span class="string">"some context"</span><span class="symbol">,</span><span class="normal"> messages</span><span class="symbol">[</span><span class="normal">index</span><span class="symbol">]);</span>
315
<span class="normal"> </span><span class="function">fputs</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">string</span><span class="symbol">);</span>
316
<span class="normal"> </span><span class="symbol">...</span>
317
<span class="cbracket">}</span></pre></td>
266
323
<div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
267
324
<h3 class="title">Note</h3>
269
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
326
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
270
327
pass <code class="option">--keyword=NC_:1c,2</code> to xgettext when extracting
271
328
messages. Note that this only works with GNU gettext >= 0.15.
272
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.
329
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.
275
332
<div class="variablelist"><table border="0">
293
350
<div class="refsect2" title="g_dgettext ()">
294
351
<a name="g-dgettext"></a><h3>g_dgettext ()</h3>
295
<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,
296
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *msgid);</pre>
352
<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_dgettext (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *domain,
353
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *msgid);</pre>
298
355
This function is a wrapper of <code class="function">dgettext()</code> which does not translate
299
356
the message if the default domain as set with <code class="function">textdomain()</code> has no
335
392
Applications should normally not use this function directly,
336
393
but use the <code class="function">_()</code> macro for translations.</p>
339
394
<div class="variablelist"><table border="0">
340
395
<col align="left" valign="top">
343
398
<td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
344
<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
399
<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
345
400
the domain set with <code class="function">textdomain()</code>
364
419
<div class="refsect2" title="g_dngettext ()">
365
420
<a name="g-dngettext"></a><h3>g_dngettext ()</h3>
366
<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,
367
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *msgid,
368
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *msgid_plural,
369
<a class="link" href="glib-Basic-Types.html#gulong" title="gulong">gulong</a> n);</pre>
421
<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_dngettext (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *domain,
422
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *msgid,
423
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *msgid_plural,
424
<a class="link" href="glib-Basic-Types.html#gulong" title="gulong"><span class="returnvalue">gulong</span></a> n);</pre>
371
426
This function is a wrapper of <code class="function">dngettext()</code> which does not translate
372
427
the message if the default domain as set with <code class="function">textdomain()</code> has no
415
468
<div class="refsect2" title="g_dpgettext ()">
416
469
<a name="g-dpgettext"></a><h3>g_dpgettext ()</h3>
417
<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,
418
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *msgctxtid,
419
<a class="link" href="glib-Basic-Types.html#gsize" title="gsize">gsize</a> msgidoffset);</pre>
470
<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_dpgettext (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *domain,
471
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *msgctxtid,
472
<a class="link" href="glib-Basic-Types.html#gsize" title="gsize"><span class="returnvalue">gsize</span></a> msgidoffset);</pre>
421
474
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
422
475
a disambiguating message context. GNU gettext uses the
434
487
Applications should normally not use this function directly,
435
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>
488
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>
438
489
<div class="variablelist"><table border="0">
439
490
<col align="left" valign="top">
442
493
<td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
443
<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
494
<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
444
495
the domain set with <code class="function">textdomain()</code>
469
520
<div class="refsect2" title="g_dpgettext2 ()">
470
521
<a name="g-dpgettext2"></a><h3>g_dpgettext2 ()</h3>
471
<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,
472
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *context,
473
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *msgid);</pre>
522
<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_dpgettext2 (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *domain,
523
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *context,
524
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *msgid);</pre>
475
526
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
476
527
a disambiguating message context. GNU gettext uses the
482
533
with <code class="function">dgettext()</code> proper.
485
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
536
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
486
537
thus you may use non-string-literals as context and msgid arguments.</p>
489
538
<div class="variablelist"><table border="0">
490
539
<col align="left" valign="top">
493
542
<td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
494
<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
543
<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
495
544
the domain set with <code class="function">textdomain()</code>
519
568
<div class="refsect2" title="g_strip_context ()">
520
569
<a name="g-strip-context"></a><h3>g_strip_context ()</h3>
521
<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,
522
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *msgval);</pre>
524
An auxiliary function for <code class="function">gettext()</code> support (see <a class="link" href="glib-I18N.html#Q---CAPS" title="Q_()"><code class="function">Q_()</code></a>).</p>
570
<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_strip_context (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *msgid,
571
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *msgval);</pre>
573
An auxiliary function for <code class="function">gettext()</code> support (see <a class="link" href="glib-I18N.html#Q-:CAPS" title="Q_()"><code class="function">Q_()</code></a>).</p>
527
574
<div class="variablelist"><table border="0">
528
575
<col align="left" valign="top">
567
614
This function consults the environment variables <code class="envar">LANGUAGE</code>,
568
615
<code class="envar">LC_ALL</code>, <code class="envar">LC_MESSAGES</code> and <code class="envar">LANG</code>
569
616
to find the list of locales specified by the user.</p>
572
617
<div class="variablelist"><table border="0">
573
618
<col align="left" valign="top">
575
620
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
576
<td> a <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated array of strings owned by GLib
621
<td> a <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated array of strings owned by GLib
577
622
that must not be modified or freed.