1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>Internationalization</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
7 <link rel="home" href="index.html" title="GLib Reference Manual">
8 <link rel="up" href="glib-utilities.html" title="GLib Utilities">
9 <link rel="prev" href="glib-Data-Checksums.html" title="Data Checksums">
10 <link rel="next" href="glib-Date-and-Time-Functions.html" title="Date and Time Functions">
11 <meta name="generator" content="GTK-Doc V1.13 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 <link rel="chapter" href="glib.html" title="GLib Overview">
14 <link rel="chapter" href="glib-fundamentals.html" title="GLib Fundamentals">
15 <link rel="chapter" href="glib-core.html" title="GLib Core Application Support">
16 <link rel="chapter" href="glib-utilities.html" title="GLib Utilities">
17 <link rel="chapter" href="glib-data-types.html" title="GLib Data Types">
18 <link rel="chapter" href="tools.html" title="GLib Tools">
19 <link rel="index" href="api-index-full.html" title="Index">
20 <link rel="index" href="api-index-deprecated.html" title="Index of deprecated symbols">
21 <link rel="index" href="api-index-2-2.html" title="Index of new symbols in 2.2">
22 <link rel="index" href="api-index-2-4.html" title="Index of new symbols in 2.4">
23 <link rel="index" href="api-index-2-6.html" title="Index of new symbols in 2.6">
24 <link rel="index" href="api-index-2-8.html" title="Index of new symbols in 2.8">
25 <link rel="index" href="api-index-2-10.html" title="Index of new symbols in 2.10">
26 <link rel="index" href="api-index-2-12.html" title="Index of new symbols in 2.12">
27 <link rel="index" href="api-index-2-14.html" title="Index of new symbols in 2.14">
28 <link rel="index" href="api-index-2-16.html" title="Index of new symbols in 2.16">
29 <link rel="index" href="api-index-2-18.html" title="Index of new symbols in 2.18">
30 <link rel="index" href="api-index-2-20.html" title="Index of new symbols in 2.20">
31 <link rel="index" href="api-index-2-22.html" title="Index of new symbols in 2.22">
32 <link rel="index" href="api-index-2-24.html" title="Index of new symbols in 2.24">
34 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
35 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
37 <td><a accesskey="p" href="glib-Data-Checksums.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
38 <td><a accesskey="u" href="glib-utilities.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
39 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
40 <th width="100%" align="center">GLib Reference Manual</th>
41 <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>
43 <tr><td colspan="5" class="shortcuts">
44 <a href="#glib-I18N.synopsis" class="shortcut">Top</a>
46 <a href="#glib-I18N.description" class="shortcut">Description</a>
49 <div class="refentry" title="Internationalization">
50 <a name="glib-I18N"></a><div class="titlepage"></div>
51 <div class="refnamediv"><table width="100%"><tr>
53 <h2><span class="refentrytitle"><a name="glib-I18N.top_of_page"></a>Internationalization</span></h2>
54 <p>Internationalization — gettext support macros</p>
56 <td valign="top" align="right"></td>
58 <div class="refsynopsisdiv" title="Synopsis">
59 <a name="glib-I18N.synopsis"></a><h2>Synopsis</h2>
60 <pre class="synopsis">
61 #include <glib.h>
62 #include <glib/gi18n.h>
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);
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);
86 <div class="refsect1" title="Description">
87 <a name="glib-I18N.description"></a><h2>Description</h2>
89 GLib doesn't force any particular localization method upon its users.
90 But since GLib itself is localized using the <code class="function">gettext()</code> mechanism, it seems
91 natural to offer the de-facto standard <code class="function">gettext()</code> support macros in an
95 In order to use these macros in an application, you must include
96 <code class="filename">glib/gi18n.h</code>. For use in a library, must include
97 <code class="filename">glib/gi18n-lib.h</code> <span class="emphasis"><em>after</em></span> defining
98 the GETTEXT_PACKAGE macro suitably for your library:
100 <div class="informalexample"><pre class="programlisting">
101 #define GETTEXT_PACKAGE "gtk20"
102 #include <glib/gi18n-lib.h>
105 The gettext manual covers details of how to set up message extraction
109 <div class="refsect1" title="Details">
110 <a name="glib-I18N.details"></a><h2>Details</h2>
111 <div class="refsect2" title="Q_()">
112 <a name="Q-:CAPS"></a><h3>Q_()</h3>
113 <pre class="programlisting">#define Q_(String)</pre>
115 Like <code class="function">_()</code>, but handles context in message ids. This has the advantage that
116 the string can be adorned with a prefix to guarantee uniqueness and provide
117 context to the translator.
120 One use case given in the gettext manual is GUI translation, where one could
121 e.g. disambiguate two "Open" menu entries as "File|Open" and "Printer|Open".
122 Another use case is the string "Russian" which may have to be translated
123 differently depending on whether it's the name of a character set or a
124 language. This could be solved by using "charset|Russian" and
128 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
131 <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
132 <h3 class="title">Note</h3>
134 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
135 pass <code class="option">--keyword=Q_</code> to xgettext when extracting messages.
136 If you are using GNU gettext >= 0.15, you can also use
137 <code class="option">--keyword=Q_:1g</code> to let xgettext split the context
138 string off into a msgctxt line in the po file.
141 <div class="variablelist"><table border="0">
142 <col align="left" valign="top">
145 <td><p><span class="term"><em class="parameter"><code>String</code></em> :</span></p></td>
146 <td>the string to be translated, with a '|'-separated prefix which
147 must not be translated
151 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
152 <td>the translated message
157 <p class="since">Since 2.4</p>
160 <div class="refsect2" title="C_()">
161 <a name="C-:CAPS"></a><h3>C_()</h3>
162 <pre class="programlisting">#define C_(Context,String)</pre>
164 Uses gettext to get the translation for <em class="parameter"><code>msgid</code></em>. <em class="parameter"><code>msgctxt</code></em> is
165 used as a context. This is mainly useful for short strings which
166 may need different translations, depending on the context in which
169 <div class="informalexample"><pre class="programlisting">
170 label1 = C_("Navigation", "Back");
171 label2 = C_("Body part", "Back");
175 <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
176 <h3 class="title">Note</h3>
178 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
179 pass <code class="option">--keyword=C_:1c,2</code> to xgettext when extracting
180 messages. Note that this only works with GNU gettext >= 0.15.
183 <div class="variablelist"><table border="0">
184 <col align="left" valign="top">
187 <td><p><span class="term"><em class="parameter"><code>Context</code></em> :</span></p></td>
188 <td>a message context, must be a string literal
192 <td><p><span class="term"><em class="parameter"><code>String</code></em> :</span></p></td>
193 <td>a message id, must be a string literal
197 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
198 <td>the translated message
203 <p class="since">Since 2.16</p>
206 <div class="refsect2" title="N_()">
207 <a name="N-:CAPS"></a><h3>N_()</h3>
208 <pre class="programlisting">#define N_(String)</pre>
210 Only marks a string for translation.
211 This is useful in situations where the translated strings can't
212 be directly used, e.g. in string array initializers.
213 To get the translated string, call <code class="function">gettext()</code> at runtime.
215 <div class="informalexample"><pre class="programlisting">
217 static const char *messages[] = {
218 N_("some very meaningful message"),
219 N_("and another one")
224 = index > 1 ? _("a default message") : gettext (messages[index]);
230 <div class="variablelist"><table border="0">
231 <col align="left" valign="top">
233 <td><p><span class="term"><em class="parameter"><code>String</code></em> :</span></p></td>
234 <td>the string to be translated
238 <p class="since">Since 2.4</p>
241 <div class="refsect2" title="NC_()">
242 <a name="NC-:CAPS"></a><h3>NC_()</h3>
243 <pre class="programlisting">#define NC_(Context, String)</pre>
245 Only marks a string for translation, with context.
246 This is useful in situations where the translated strings can't
247 be directly used, e.g. in string array initializers.
248 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.
250 <div class="informalexample"><pre class="programlisting">
252 static const char *messages[] = {
253 NC_("some context", "some very meaningful message"),
254 NC_("some context", "and another one")
259 = index > 1 ? g_dpgettext2 (NULL, "some context", "a default message") : g_dpgettext2 (NULL, "some context", messages[index]);
265 <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
266 <h3 class="title">Note</h3>
268 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
269 pass <code class="option">--keyword=NC_:1c,2</code> to xgettext when extracting
270 messages. Note that this only works with GNU gettext >= 0.15.
271 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.
274 <div class="variablelist"><table border="0">
275 <col align="left" valign="top">
278 <td><p><span class="term"><em class="parameter"><code>Context</code></em> :</span></p></td>
279 <td>a message context, must be a string literal
283 <td><p><span class="term"><em class="parameter"><code>String</code></em> :</span></p></td>
284 <td>a message id, must be a string literal
289 <p class="since">Since 2.18</p>
292 <div class="refsect2" title="g_dgettext ()">
293 <a name="g-dgettext"></a><h3>g_dgettext ()</h3>
294 <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,
295 const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *msgid);</pre>
297 This function is a wrapper of <code class="function">dgettext()</code> which does not translate
298 the message if the default domain as set with <code class="function">textdomain()</code> has no
299 translations for the current locale.
302 The advantage of using this function over <code class="function">dgettext()</code> proper is that
303 libraries using this function (like GTK+) will not use translations
304 if the application using the library does not have translations for
305 the current locale. This results in a consistent English-only
306 interface instead of one having partial translations. For this
307 feature to work, the call to <code class="function">textdomain()</code> and <a class="link" href="glib-running.html#setlocale" title="Locale"><code class="function">setlocale()</code></a> should
308 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
309 <code class="function">textdomain()</code> before gtk_init or its variants.
312 This function disables translations if and only if upon its first
313 call all the following conditions hold:
315 <div class="itemizedlist"><ul class="itemizedlist" type="disc">
316 <li class="listitem">
317 <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>
319 <li class="listitem">
320 <code class="function">textdomain()</code> has been called to set a default text domain</li>
321 <li class="listitem">there is no translations available for the default text domain
322 and the current locale</li>
323 <li class="listitem">current locale is not "C" or any English locales (those
324 starting with "en_")</li>
329 Note that this behavior may not be desired for example if an application
330 has its untranslated messages in a language other than English. In those
331 cases the application should call <code class="function">textdomain()</code> after initializing GTK+.
334 Applications should normally not use this function directly,
335 but use the <code class="function">_()</code> macro for translations.</p>
336 <div class="variablelist"><table border="0">
337 <col align="left" valign="top">
340 <td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
341 <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
342 the domain set with <code class="function">textdomain()</code>
346 <td><p><span class="term"><em class="parameter"><code>msgid</code></em> :</span></p></td>
347 <td> message to translate
351 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
352 <td> The translated string
358 <p class="since">Since 2.18</p>
361 <div class="refsect2" title="g_dngettext ()">
362 <a name="g-dngettext"></a><h3>g_dngettext ()</h3>
363 <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,
364 const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *msgid,
365 const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *msgid_plural,
366 <a class="link" href="glib-Basic-Types.html#gulong" title="gulong"><span class="returnvalue">gulong</span></a> n);</pre>
368 This function is a wrapper of <code class="function">dngettext()</code> which does not translate
369 the message if the default domain as set with <code class="function">textdomain()</code> has no
370 translations for the current locale.
373 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>
375 <div class="variablelist"><table border="0">
376 <col align="left" valign="top">
379 <td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
380 <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
381 the domain set with <code class="function">textdomain()</code>
385 <td><p><span class="term"><em class="parameter"><code>msgid</code></em> :</span></p></td>
386 <td> message to translate
390 <td><p><span class="term"><em class="parameter"><code>msgid_plural</code></em> :</span></p></td>
391 <td> plural form of the message
395 <td><p><span class="term"><em class="parameter"><code>n</code></em> :</span></p></td>
396 <td> the quantity for which translation is needed
400 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
401 <td> The translated string
407 <p class="since">Since 2.18</p>
410 <div class="refsect2" title="g_dpgettext ()">
411 <a name="g-dpgettext"></a><h3>g_dpgettext ()</h3>
412 <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,
413 const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *msgctxtid,
414 <a class="link" href="glib-Basic-Types.html#gsize" title="gsize"><span class="returnvalue">gsize</span></a> msgidoffset);</pre>
416 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
417 a disambiguating message context. GNU gettext uses the
418 '\004' character to separate the message context and
419 message id in <em class="parameter"><code>msgctxtid</code></em>.
420 If 0 is passed as <em class="parameter"><code>msgidoffset</code></em>, this function will fall back to
421 trying to use the deprecated convention of using "|" as a separation
425 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
426 with <code class="function">dgettext()</code> proper.
429 Applications should normally not use this function directly,
430 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>
431 <div class="variablelist"><table border="0">
432 <col align="left" valign="top">
435 <td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
436 <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
437 the domain set with <code class="function">textdomain()</code>
441 <td><p><span class="term"><em class="parameter"><code>msgctxtid</code></em> :</span></p></td>
442 <td> a combined message context and message id, separated
447 <td><p><span class="term"><em class="parameter"><code>msgidoffset</code></em> :</span></p></td>
448 <td> the offset of the message id in <em class="parameter"><code>msgctxid</code></em>
452 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
453 <td> The translated string
459 <p class="since">Since 2.16</p>
462 <div class="refsect2" title="g_dpgettext2 ()">
463 <a name="g-dpgettext2"></a><h3>g_dpgettext2 ()</h3>
464 <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,
465 const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *context,
466 const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *msgid);</pre>
468 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
469 a disambiguating message context. GNU gettext uses the
470 '\004' character to separate the message context and
471 message id in <em class="parameter"><code>msgctxtid</code></em>.
474 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
475 with <code class="function">dgettext()</code> proper.
478 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
479 thus you may use non-string-literals as context and msgid arguments.</p>
480 <div class="variablelist"><table border="0">
481 <col align="left" valign="top">
484 <td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
485 <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
486 the domain set with <code class="function">textdomain()</code>
490 <td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
491 <td> the message context
495 <td><p><span class="term"><em class="parameter"><code>msgid</code></em> :</span></p></td>
500 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
501 <td> The translated string
507 <p class="since">Since 2.18</p>
510 <div class="refsect2" title="g_strip_context ()">
511 <a name="g-strip-context"></a><h3>g_strip_context ()</h3>
512 <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,
513 const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *msgval);</pre>
515 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>
516 <div class="variablelist"><table border="0">
517 <col align="left" valign="top">
520 <td><p><span class="term"><em class="parameter"><code>msgid</code></em> :</span></p></td>
525 <td><p><span class="term"><em class="parameter"><code>msgval</code></em> :</span></p></td>
530 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
531 <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
532 a '|' character, in which case a pointer to the substring of msgid after
533 the first '|' character is returned.
539 <p class="since">Since 2.4</p>
542 <div class="refsect2" title="g_get_language_names ()">
543 <a name="g-get-language-names"></a><h3>g_get_language_names ()</h3>
544 <pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a>* const * g_get_language_names (void);</pre>
546 Computes a list of applicable locale names, which can be used to
547 e.g. construct locale-dependent filenames or search paths. The returned
548 list is sorted from most desirable to least desirable and always contains
549 the default locale "C".
552 For example, if LANGUAGE=de:en_US, then the returned list is
553 "de", "en_US", "en", "C".
556 This function consults the environment variables <code class="envar">LANGUAGE</code>,
557 <code class="envar">LC_ALL</code>, <code class="envar">LC_MESSAGES</code> and <code class="envar">LANG</code>
558 to find the list of locales specified by the user.</p>
559 <div class="variablelist"><table border="0">
560 <col align="left" valign="top">
562 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
563 <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
564 that must not be modified or freed.
569 <p class="since">Since 2.6</p>
572 <div class="refsect1" title="See Also">
573 <a name="glib-I18N.see-also"></a><h2>See Also</h2>
581 Generated by GTK-Doc V1.13</div>