📄 libgnome-gnome-i18n.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"><title>gnome-i18n</title><meta name="generator" content="DocBook XSL Stylesheets V1.69.1"><link rel="start" href="index.html" title="GNOME Library Reference Manual"><link rel="up" href="ch01s02.html" title="Configuration"><link rel="prev" href="libgnome-gnome-config.html" title="gnome-config"><link rel="next" href="ch01s03.html" title="Displaying help and external info"><meta name="generator" content="GTK-Doc V1.7 (XML mode)"><link rel="stylesheet" href="style.css" type="text/css"><link rel="chapter" href="libgnome.html" title="GNOME Library (libgnome)"></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="libgnome-gnome-config.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="ch01s02.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">GNOME Library Reference Manual</th><td><a accesskey="n" href="ch01s03.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr><tr><td colspan="5" class="shortcuts"><nobr><a href="#id2813915" class="shortcut">Top</a>  |  <a href="#id2813983" class="shortcut">Description</a></nobr></td></tr></table><div class="refentry" lang="en"><a name="libgnome-gnome-i18n"></a><div class="titlepage"></div><div class="refnamediv"><table width="100%"><tr><td valign="top"><h2><a name="id2813915"></a><span class="refentrytitle">gnome-i18n</span></h2><p>gnome-i18n — Support for localization and internationalization.</p></td><td valign="top" align="right"></td></tr></table></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">#include <libgnome/libgnome.h>const <ahref="/usr/share/gtk-doc/html/glib/glib-Doubly-Linked-Lists.html#GList">GList</a>* <a href="libgnome-gnome-i18n.html#gnome-i18n-get-language-list">gnome_i18n_get_language_list</a> (const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *category_name);void <a href="libgnome-gnome-i18n.html#gnome-i18n-push-c-numeric-locale">gnome_i18n_push_c_numeric_locale</a> (void);void <a href="libgnome-gnome-i18n.html#gnome-i18n-pop-c-numeric-locale">gnome_i18n_pop_c_numeric_locale</a> (void);</pre></div><div class="refsect1" lang="en"><a name="id2813983"></a><h2>Description</h2><p>This module allows the programmer to internationalize his application byproviding functions to retrieve the preferred languages of the user as well astemporarily move back to the C locale for performing locale independentoperations.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> A lot of the internationalization functions which were in this module in GNOME 1 have now moved to libbonobo for GNOME 2 (<ahref="/usr/share/gtk-doc/html/libbonobo/libbonobo-bonobo-i18n.html#gettext-macro"><code class="function">_()</code></a>, <ahref="/usr/share/gtk-doc/html/libbonobo/libbonobo-bonobo-i18n.html#textdomain"><code class="function">textdomain()</code></a>, <ahref="/usr/share/gtk-doc/html/libbonobo/libbonobo-bonobo-i18n.html#gettext"><code class="function">gettext()</code></a>, etc). </p></div></div><div class="refsect1" lang="en"><a name="id2814044"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id2814055"></a><h3><a name="gnome-i18n-get-language-list"></a>gnome_i18n_get_language_list ()</h3><a class="indexterm" name="id2814070"></a><pre class="programlisting">const <ahref="/usr/share/gtk-doc/html/glib/glib-Doubly-Linked-Lists.html#GList">GList</a>* gnome_i18n_get_language_list (const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *category_name);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gnome_i18n_get_language_list</code> is deprecated and should not be used in newly-written code.</p></div><p>This function is deprecated. You should be using <ahref="/usr/share/gtk-doc/html/glib/glib-I18N.html#g-get-language-names"><code class="function">g_get_language_names()</code></a> instead.</p><p>This computes a list of language strings that the user wants. It searches inthe standard environment variables to find the list, which is sorted in orderfrom most desirable to least desirable. The `C' locale is appended to thelist if it does not already appear (other routines depend on thisbehaviour).</p><p>The <em class="parameter"><code>ignored</code></em> argument used to be the category name to use, but this wasremoved since there is only one useful thing to pass here. For furtherdetails, see http://bugzilla.gnome.org/show_bug.cgi?id=168948</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>category_name</code></em> :</span></td><td></td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the list of languages, this list should not be freed as it isowned by gnome-i18n.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2814179"></a><h3><a name="gnome-i18n-push-c-numeric-locale"></a>gnome_i18n_push_c_numeric_locale ()</h3><a class="indexterm" name="id2814195"></a><pre class="programlisting">void gnome_i18n_push_c_numeric_locale (void);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gnome_i18n_push_c_numeric_locale</code> is deprecated and should not be used in newly-written code.</p></div><p>Saves the current LC_NUMERIC locale and sets it to "C"This way you can safely read write floating point numbers all in thesame format. You should make sure that code between<a href="libgnome-gnome-i18n.html#gnome-i18n-push-c-numeric-locale"><code class="function">gnome_i18n_push_c_numeric_locale()</code></a> and <a href="libgnome-gnome-i18n.html#gnome-i18n-pop-c-numeric-locale"><code class="function">gnome_i18n_pop_c_numeric_locale()</code></a>doesn't do any setlocale calls or locale may end up in a strange setting.Also make sure to always pop the c numeric locale after you've pushed it.The calls can be nested.</p><p></p></div><hr><div class="refsect2" lang="en"><a name="id2814262"></a><h3><a name="gnome-i18n-pop-c-numeric-locale"></a>gnome_i18n_pop_c_numeric_locale ()</h3><a class="indexterm" name="id2814277"></a><pre class="programlisting">void gnome_i18n_pop_c_numeric_locale (void);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gnome_i18n_pop_c_numeric_locale</code> is deprecated and should not be used in newly-written code.</p></div><p>Restores the LC_NUMERIC locale to what it wasbefore the matching <a href="libgnome-gnome-i18n.html#gnome-i18n-push-c-numeric-locale"><code class="function">gnome_i18n_push_c_numeric_locale()</code></a>. If these callswere nested, then this is a no-op until we get to the most outermostlayer. Code in between these should not do any setlocale callsto change the LC_NUMERIC locale or things may come out very strange.</p><p></p></div></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -