亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sec-i18n.html

?? gtk_text program sample&eg
?? HTML
字號:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html>  <head>    <title>      Internationalization    </title>    <meta name="GENERATOR" content=    "Modular DocBook HTML Stylesheet Version 1.45">    <link rel="HOME" title="GTK+ / Gnome Application Development"    href="ggad.html">    <link rel="UP" title="Gnome Application Basics" href=     "cha-startup.html">    <link rel="PREVIOUS" title="Gnome Application Basics" href=     "cha-startup.html">    <link rel="NEXT" title="Argument Parsing with popt" href=     "z77.html">  </head>  <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink=   "#840084" alink="#0000FF">    <div class="NAVHEADER">      <table width="100%" border="0" bgcolor="#ffffff" cellpadding=       "1" cellspacing="0">        <tr>          <th colspan="4" align="center">            <font color="#000000" size="2">GTK+ / Gnome Application            Development</font>          </th>        </tr>        <tr>          <td width="25%" bgcolor="#ffffff" align="left">            <a href="cha-startup.html"><font color="#0000ff" size=            "2"><b>&lt;&lt;&lt; Previous</b></font></a>          </td>          <td width="25%" colspan="2" bgcolor="#ffffff" align=           "center">            <font color="#0000ff" size="2"><b><a href="ggad.html">            <font color="#0000ff" size="2"><b>            Home</b></font></a></b></font>          </td>          <td width="25%" bgcolor="#ffffff" align="right">            <a href="z77.html"><font color="#0000ff" size="2"><b>            Next &gt;&gt;&gt;</b></font></a>          </td>        </tr>      </table>    </div>    <div class="SECT1">      <h1 class="SECT1">        <a name="SEC-I18N">Internationalization</a>      </h1>      <p>        All user-visible strings in a Gnome application should be        marked for translation. Translation is achieved using the        GNU <tt class="APPLICATION">gettext</tt> facility. <tt        class="APPLICATION">gettext</tt> is simply a message        catalog; it stores key-value pairs, where the key is the        string hard-coded into the program, and the value is a        translated string (if appropriate) or simply the key (if        there's no translation, or the key is already in the        correct language).      </p>      <p>        As a programmer, it's not your responsibility to provide        translations. However, you must make sure strings are        marked for translation---so that <tt class="APPLICATION">        gettext</tt>'s scripts can extract a list of strings to be        translated---and you must call a special function on each        string when the catalog lookup should take place.      </p>      <div class="FIGURE">        <a name="ML-I18N"></a>        <div class="FUNCSYNOPSIS">          <a name="ML-I18N.SYNOPSIS"></a>          <table border="0" bgcolor="#E0E0E0" width="100%">            <tr>              <td><pre class="FUNCSYNOPSISINFO">#include &lt;libgnome/gnome-i18n.h&gt;</pre>              </td>            </tr>          </table>          <p>            <code><code class="FUNCDEF"><tt class="FUNCTION">            _</tt></code>(<tt class=            "PARAMETER"><i>string</i></tt>);</code>          </p>          <p>            <code><code class="FUNCDEF"><tt class="FUNCTION">            N_</tt></code>(<tt class=            "PARAMETER"><i>string</i></tt>);</code>          </p>        </div>        <p>          <b>Figure 2. Translation Macros</b>        </p>      </div>      <p>        Gnome makes this easy, by defining two macros shown in <a        href="sec-i18n.html#ML-I18N">Figure 2</a>. The macro <tt        class="FUNCTION">_()</tt> both marks the string for        translation and performs the message-catalog lookup. You        should use it in any context C permits a function call. The        <tt class="FUNCTION">N_()</tt> macro is a no-op, but marks        the string for translation. You can use it when C does not        permit a function call; for example in static array        initializers. If you mark a string for translation with <tt        class="FUNCTION">N_()</tt>, you must eventually call <tt        class="FUNCTION">_()</tt> on it to actually perform the        lookup.      </p>      <p>        Here's a simple example:      </p>      <table border="0" bgcolor="#E0E0E0" width="100%">        <tr>          <td><pre class="PROGRAMLISTING">&#13;#include &lt;gnome.h&gt;static char* a[] = {   N_("Translate Me"),  N_("Me Too")};int main(int argc, char** argv){  bindtextdomain(PACKAGE, GNOMELOCALEDIR);  textdomain(PACKAGE);  printf(_("Translated String\n"));  printf(_(a[0]));  printf(_(a[1]));  return 0;}&#13;</pre>          </td>        </tr>      </table>      <p>        Notice that the string literals <span class="STRUCTNAME">        "Translate Me"</span> and <span class="STRUCTNAME">"Me        Too"</span> are marked so that <tt class="APPLICATION">        gettext</tt> can find them and produce a list of strings to        be translated. Translators will use this list to create the        actual translations. Later, <tt class="FUNCTION">_()</tt>        includes a function call to perform the tranlation lookup        on each member of the array. Since a function call is        allowed when the string literal <span class="STRUCTNAME">        "Translated String"</span> is introduced, everything can        happen in a single step.      </p>      <p>        At the beginning of your program, you have to call <tt        class="FUNCTION">bindtextdomain()</tt> and <tt class=         "FUNCTION">textdomain()</tt> as shown in the above example.        In the above code, <tt class="FUNCTION">PACKAGE</tt> is a        string representing the package the program is found in,        typically defined in <tt class="FILENAME">config.h</tt>        (see <a href="cha-source.html">the chapter called <i>        Creating Your Source Tree</i></a>). You must arrange to        define <tt class="FUNCTION">GNOMELOCALEDIR</tt>, typically        in your <tt class="FILENAME">Makefile.am</tt> (<tt class=         "APPLICATION">$(prefix)/share/locale</tt>, or <tt class=         "APPLICATION">$(datadir)/locale</tt>, is the standard        value). Translations are stored in <tt class="FUNCTION">        GNOMELOCALEDIR</tt>.      </p>      <p>        When marking strings for translation, you must make sure        your strings are translatable. Avoid constructing a string        at runtime via concatenation. For example, do not do this:      </p>      <table border="0" bgcolor="#E0E0E0" width="100%">        <tr>          <td><pre class="PROGRAMLISTING">&#13;  gchar* message = g_strconcat(_("There is an error on device "),                                device, NULL);&#13;</pre>          </td>        </tr>      </table>      <p>        The problem is that in some languages it may be correct to        put the name of the device first (or in the middle). If you        use <tt class="FUNCTION">g_snprintf()</tt> or <tt class=         "FUNCTION">g_strdup_printf()</tt> instead of concatenation,        the translator can change the word order. Here's the right        way to do it:      </p>      <table border="0" bgcolor="#E0E0E0" width="100%">        <tr>          <td><pre class="PROGRAMLISTING">&#13;  gchar* message = g_strdup_printf(_("There is an error on device %s"),                                   device);&#13;</pre>          </td>        </tr>      </table>      <p>        Now the translator can move <span class="STRUCTNAME">        %s</span> as needed.      </p>      <p>        Complicated syntax-on-the-fly should be avoided whenever        possible. For example, translating this is a major problem:      </p>      <table border="0" bgcolor="#E0E0E0" width="100%">        <tr>          <td><pre class="PROGRAMLISTING">&#13;  printf(_("There %s %d dog%s\n"),          n_dogs &gt; 1 ? _("were") : _("was"),         n_dogs,          n_dogs &gt; 1 ? _("s") : "");&#13;</pre>          </td>        </tr>      </table>      <p>        It is better to move the conditional out of the <tt class=         "FUNCTION">printf()</tt>:      </p>      <table border="0" bgcolor="#E0E0E0" width="100%">        <tr>          <td><pre class="PROGRAMLISTING">&#13;  if (n_dogs &gt; 0)    printf(_("There were %d dogs\n"), n_dogs);  else     printf(_("There was 1 dog\n"));&#13;</pre>          </td>        </tr>      </table>      <p>        However, as the <tt class="APPLICATION">gettext</tt> manual        points out, even this will not always work; some languages        will distinguish more categories than "exactly one" and        "more than one" (that is, they might have a word form for        "exactly two" in addition to English's singular and plural        forms). That manual suggests that a lookup table indexed by        the number you plan to use might work in some cases:      </p>      <table border="0" bgcolor="#E0E0E0" width="100%">        <tr>          <td><pre class="PROGRAMLISTING">&#13;static const char* ndogs_phrases[] = {  N_("There were no dogs.\n"),  N_("There was one dog.\n"),  N_("There were two dogs.\n"),  N_("There were three dogs.\n")};&#13;</pre>          </td>        </tr>      </table>      <p>        As you can see, this rapidly becomes unpleasant to deal        with. Avoid it if you can. The <tt class="APPLICATION">        gettext</tt> documentation has more examples, if you find        yourself in a hairy situation.      </p>      <p>        Internationalization must also be considered when parsing        or displaying certain kinds of data, including dates and        decimal numbers. In general, the C library provides        sufficient facilities to deal with this; use <tt class=         "FUNCTION">strftime()</tt>, <tt class="FUNCTION">        strcoll()</tt>, and so on to handle these cases; a good C        or POSIX book will explain them. The glib <span class=         "STRUCTNAME">GDate</span> facility handles dates using <tt        class="FUNCTION">strftime()</tt> internally.      </p>      <p>        One common mistake to avoid: don't use locale-dependent        functions when reading and writing files. For example, <tt        class="FUNCTION">printf()</tt> and <tt class="FUNCTION">        scanf()</tt> adjust their decimal number format for the        locale, so you can't use this format in files. Users in        Europe won't be able to read files created in the United        States.      </p>    </div>    <div class="NAVFOOTER">      <br>      <br>      <table width="100%" border="0" bgcolor="#ffffff" cellpadding=       "1" cellspacing="0">        <tr>          <td width="25%" bgcolor="#ffffff" align="left">            <a href="cha-startup.html"><font color="#0000ff" size=            "2"><b>&lt;&lt;&lt; Previous</b></font></a>          </td>          <td width="25%" colspan="2" bgcolor="#ffffff" align=           "center">            <font color="#0000ff" size="2"><b><a href="ggad.html">            <font color="#0000ff" size="2"><b>            Home</b></font></a></b></font>          </td>          <td width="25%" bgcolor="#ffffff" align="right">            <a href="z77.html"><font color="#0000ff" size="2"><b>            Next &gt;&gt;&gt;</b></font></a>          </td>        </tr>        <tr>          <td colspan="2" align="left">            <font color="#000000" size="2"><b>Gnome Application            Basics</b></font>          </td>          <td colspan="2" align="right">            <font color="#000000" size="2"><b>Argument Parsing with            <tt class="APPLICATION">popt</tt></b></font>          </td>        </tr>      </table>    </div>  </body></html>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品小仙女| 奇米精品一区二区三区在线观看 | 久久精品99久久久| 色吧成人激情小说| 国产喷白浆一区二区三区| 本田岬高潮一区二区三区| 日日摸夜夜添夜夜添国产精品| 日韩精品久久理论片| av在线不卡免费看| 欧美日韩成人综合| 亚洲欧美色综合| 9i看片成人免费高清| 亚洲三级在线观看| 91蜜桃在线观看| 亚洲成人一区在线| 亚洲国产高清不卡| 一本久道久久综合中文字幕| 一区二区中文字幕在线| 一区二区三区在线播| 美女在线观看视频一区二区| 欧美性视频一区二区三区| 91精品欧美一区二区三区综合在 | 91精品国产免费| 天天色天天爱天天射综合| 日韩欧美视频一区| 国产成人av资源| 一区二区高清免费观看影视大全| 91精品麻豆日日躁夜夜躁| 国产精品一品二品| 亚洲曰韩产成在线| 久久久久久久网| 在线观看视频欧美| 激情久久久久久久久久久久久久久久| 亚洲国产精品黑人久久久| 欧美丰满少妇xxxbbb| 丁香六月综合激情| 日韩 欧美一区二区三区| 中文天堂在线一区| 欧美成va人片在线观看| 91首页免费视频| 国产精品996| 日本不卡一二三| 亚洲美女视频在线| 中文字幕第一区第二区| 日韩亚洲欧美一区二区三区| av亚洲产国偷v产偷v自拍| 激情伊人五月天久久综合| 一区二区三区精品久久久| 国产区在线观看成人精品 | 免费人成精品欧美精品| 中文字幕亚洲在| 久久久综合视频| 在线电影欧美成精品| 色综合激情久久| 成人免费看的视频| 国内精品嫩模私拍在线| 五月天婷婷综合| 亚洲精品欧美激情| 国产精品久久久久久久午夜片| 这里只有精品电影| 欧美写真视频网站| 色综合久久久久久久久| 成人app在线| 国产激情91久久精品导航| 六月婷婷色综合| 日本少妇一区二区| 亚洲bt欧美bt精品777| 一区二区三区中文在线| 中文字幕日本不卡| 日韩一区欧美一区| 中文字幕欧美激情一区| 国产婷婷色一区二区三区 | 欧美精品在线观看播放| 欧洲生活片亚洲生活在线观看| www.欧美精品一二区| 成人性视频免费网站| 国产99久久久久| 成人网男人的天堂| 成人午夜电影网站| 99久久精品情趣| 99re视频精品| 日本久久电影网| 欧美午夜不卡视频| 欧美日韩精品高清| 91麻豆精品91久久久久久清纯| 欧美欧美欧美欧美首页| 51午夜精品国产| 日韩精品一区二区三区蜜臀| 日韩免费在线观看| 久久色中文字幕| 亚洲国产成人一区二区三区| 国产精品欧美经典| 亚洲靠逼com| 亚洲亚洲人成综合网络| 日韩中文字幕1| 狠狠狠色丁香婷婷综合激情| 成人综合在线网站| 91丨porny丨蝌蚪视频| 91国内精品野花午夜精品| 欧美日韩视频专区在线播放| 欧美一区二区美女| 国产亚洲精品中文字幕| 亚洲欧美日韩国产中文在线| 亚洲综合成人在线视频| 免费看欧美女人艹b| 国产九九视频一区二区三区| 99这里只有精品| 欧美三级中文字幕| 久久一区二区三区国产精品| 亚洲欧洲av在线| 视频一区视频二区在线观看| 国内精品第一页| 91色乱码一区二区三区| 欧美一区二区黄| 国产片一区二区| 日韩电影在线观看网站| 成人自拍视频在线| 欧美日韩国产在线播放网站| 26uuu国产日韩综合| 亚洲综合在线五月| 韩国在线一区二区| 欧美天堂一区二区三区| 日本一区二区视频在线观看| 一区av在线播放| 国产精品一区二区久久不卡| 在线免费av一区| 久久理论电影网| 五月婷婷欧美视频| av一区二区不卡| 亚洲精品在线电影| 一区二区三区精品| 成人黄色片在线观看| 91精品国产综合久久福利| 国产精品久久久久久久久晋中| 美女视频网站黄色亚洲| 精品视频一区 二区 三区| 中文字幕免费一区| 久久99久久99精品免视看婷婷| 91久久久免费一区二区| 国产午夜亚洲精品理论片色戒| 天堂成人国产精品一区| 91丨porny丨蝌蚪视频| 久久精品夜夜夜夜久久| 日韩高清在线电影| 欧洲av在线精品| 国产精品天天看| 国产精品69久久久久水密桃| 日韩精品中文字幕一区| 午夜精品123| 欧洲一区在线观看| 亚洲视频中文字幕| 成人免费视频视频在线观看免费| 日韩精品自拍偷拍| 日韩高清不卡一区二区三区| 91福利精品第一导航| 亚洲人精品一区| 99精品1区2区| 国产精品欧美一区二区三区| 国产成人亚洲精品青草天美| 精品国产露脸精彩对白| 久久电影网站中文字幕| 3atv在线一区二区三区| 天天色图综合网| 69精品人人人人| 日韩国产精品久久| 欧美一区二区三区精品| 蜜桃视频免费观看一区| 91精品国产91久久综合桃花| 视频一区中文字幕国产| 欧美日韩成人一区二区| 偷偷要91色婷婷| 91精品国产入口| 久色婷婷小香蕉久久| 精品国产a毛片| 韩国精品在线观看| 久久久久久一级片| 不卡一区二区三区四区| 亚洲欧洲韩国日本视频| 欧洲另类一二三四区| 五月天精品一区二区三区| 欧美精品18+| 精品一区二区日韩| 久久久久久久久久电影| 白白色 亚洲乱淫| 亚洲色图视频网| 欧美日韩五月天| 黄色精品一二区| 国产精品人妖ts系列视频| k8久久久一区二区三区| 有码一区二区三区| 欧美人动与zoxxxx乱| 韩国av一区二区| 国产精品国产三级国产普通话蜜臀| 91丝袜国产在线播放| 日韩影视精彩在线| 国产色婷婷亚洲99精品小说| 色综合视频在线观看| 三级不卡在线观看| 久久精品综合网| 91首页免费视频|