Forráskód Böngészése

chapter06: Translate gettext instruction

Xi Ruoyao 7 éve
szülő
commit
313cc825c2
1 módosított fájl, 57 hozzáadás és 64 törlés
  1. 57 64
      chapter06/gettext.xml

+ 57 - 64
chapter06/gettext.xml

@@ -23,10 +23,13 @@
   <sect2 role="package">
     <title/>
 
-    <para>The Gettext package contains utilities for internationalization and
+    <!--para>The Gettext package contains utilities for internationalization and
     localization. These allow programs to be compiled with NLS (Native Language
     Support), enabling them to output messages in the user's native
-    language.</para>
+    language.</para-->
+    <para>Gettext 软件包包含国际化和本地化工具,
+		它们允许程序在编译时加入 NLS (母语支持)功能,
+		使它们能够以用户的母语输出消息。</para>
 
     <segmentedlist>
       <segtitle>&buildtime;</segtitle>
@@ -46,8 +49,8 @@
    <!-- this has been fixed in upstream gnulib, when a new version of
    gettext is released, please check #4055 to see if the change has been
    picked up in this package -->
-   <para>First, suppress two invocations of test-lock which on some machines
-   can loop forever:</para>
+   <para>首先,取消 test-lock 的两次执行,因为它在某些机器上会死循环:
+   </para>
 
 <screen><userinput remap="pre">sed -i '/^TESTS =/d' gettext-runtime/tests/Makefile.in &amp;&amp;
 sed -i 's/test-lock..EXEEXT.//' gettext-tools/gnulib-tests/Makefile.in</userinput></screen>
@@ -62,8 +65,7 @@ sed -i 's/test-lock..EXEEXT.//' gettext-tools/gnulib-tests/Makefile.in</userinpu
 
 <screen><userinput remap="make">make</userinput></screen>
 
-    <para>To test the results (this takes a long time, around 3 SBUs),
-    issue:</para>
+    <para>输入下列命令以测试编译结果(需要较长时间, 大约 3 SBU):</para>
 
 <screen><userinput remap="test">make check</userinput></screen>
 
@@ -86,10 +88,10 @@ chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
         <seg>autopoint, envsubst, gettext, gettext.sh,
         gettextize, msgattrib, msgcat, msgcmp, msgcomm, msgconv, msgen,
         msgexec, msgfilter, msgfmt, msggrep, msginit, msgmerge, msgunfmt, msguniq,
-        ngettext, recode-sr-latin, and xgettext</seg>
+        ngettext, recode-sr-latin, 以及 xgettext</seg>
         <seg>libasprintf.so, libgettextlib.so, libgettextpo.so,
-        libgettextsrc.so, and preloadable_libintl.so</seg>
-        <seg>/usr/lib/gettext, /usr/share/doc/gettext-&gettext-version;, and
+        libgettextsrc.so, 以及 preloadable_libintl.so</seg>
+        <seg>/usr/lib/gettext, /usr/share/doc/gettext-&gettext-version;, 以及
         /usr/share/gettext</seg>
       </seglistitem>
     </segmentedlist>
@@ -102,8 +104,7 @@ chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
       <varlistentry id="autopoint">
         <term><command>autopoint</command></term>
         <listitem>
-          <para>Copies standard Gettext infrastructure files into a source
-          package</para>
+          <para>将标准 Gettext 微架构文件复制到源代码包</para>
           <indexterm zone="ch-system-gettext autopoint">
             <primary sortas="b-autopoint">autopoint</primary>
           </indexterm>
@@ -113,7 +114,7 @@ chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
       <varlistentry id="envsubst">
         <term><command>envsubst</command></term>
         <listitem>
-          <para>Substitutes environment variables in shell format strings</para>
+          <para>替换 shell 格式化字符串中的环境变量</para>
           <indexterm zone="ch-system-gettext envsubst">
             <primary sortas="b-envsubst">envsubst</primary>
           </indexterm>
@@ -123,8 +124,8 @@ chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
       <varlistentry id="gettext">
         <term><command>gettext</command></term>
         <listitem>
-          <para>Translates a natural language message into the user's language
-          by looking up the translation in a message catalog</para>
+          <para>通过查询消息目录中的翻译,将中性语言消息翻译成用户的语言
+          </para>
           <indexterm zone="ch-system-gettext gettext">
             <primary sortas="b-gettext">gettext</primary>
           </indexterm>
@@ -134,7 +135,7 @@ chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
       <varlistentry id="gettext.sh">
         <term><command>gettext.sh</command></term>
         <listitem>
-          <para>Primarily serves as a shell function library for gettext</para>
+          <para>主要用于 gettext 的 shell 函数库</para>
           <indexterm zone="ch-system-gettext gettext.sh">
             <primary sortas="b-gettext.sh">gettext.sh</primary>
           </indexterm>
@@ -144,8 +145,8 @@ chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
       <varlistentry id="gettextize">
         <term><command>gettextize</command></term>
         <listitem>
-          <para>Copies all standard Gettext files into the given top-level
-          directory of a package to begin internationalizing it</para>
+          <para>将所有标准 Gettext 文件复制到软件包顶层目录中,
+          以开始国际化该软件包</para>
           <indexterm zone="ch-system-gettext gettextize">
             <primary sortas="b-gettextize">gettextize</primary>
           </indexterm>
@@ -155,8 +156,7 @@ chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
       <varlistentry id="msgattrib">
         <term><command>msgattrib</command></term>
         <listitem>
-          <para>Filters the messages of a translation catalog according to their
-          attributes and manipulates the attributes</para>
+          <para>根据属性过滤翻译目录中的消息,或修改这些属性</para>
           <indexterm zone="ch-system-gettext msgattrib">
             <primary sortas="b-msgattrib">msgattrib</primary>
           </indexterm>
@@ -166,8 +166,8 @@ chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
       <varlistentry id="msgcat">
         <term><command>msgcat</command></term>
         <listitem>
-          <para>Concatenates and merges the given
-          <filename class="extension">.po</filename> files</para>
+          <para>连接并合并给定的
+          <filename class="extension">.po</filename> 文件</para>
           <indexterm zone="ch-system-gettext msgcat">
             <primary sortas="b-msgcat">msgcat</primary>
           </indexterm>
@@ -177,8 +177,8 @@ chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
       <varlistentry id="msgcmp">
         <term><command>msgcmp</command></term>
         <listitem>
-          <para>Compares two <filename class="extension">.po</filename>
-          files to check that both contain the same set of msgid strings</para>
+          <para>比较两个 <filename class="extension">.po</filename>
+          文件,以检查它们是否包含相同的 msgid 字符串集合</para>
           <indexterm zone="ch-system-gettext msgcmp">
             <primary sortas="b-msgcmp">msgcmp</primary>
           </indexterm>
@@ -188,8 +188,8 @@ chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
       <varlistentry id="msgcomm">
         <term><command>msgcomm</command></term>
         <listitem>
-          <para>Finds the messages that are common to the given
-          <filename class="extension">.po</filename> files</para>
+          <para>找出给定的多个
+          <filename class="extension">.po</filename> 中的公共消息</para>
           <indexterm zone="ch-system-gettext msgcomm">
             <primary sortas="b-msgcomm">msgcomm</primary>
           </indexterm>
@@ -199,8 +199,7 @@ chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
       <varlistentry id="msgconv">
         <term><command>msgconv</command></term>
         <listitem>
-          <para>Converts a translation catalog to a different character
-          encoding</para>
+          <para>将翻译目录转换成另一种字符编码</para>
           <indexterm zone="ch-system-gettext msgconv">
             <primary sortas="b-msgconv">msgconv</primary>
           </indexterm>
@@ -210,7 +209,7 @@ chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
       <varlistentry id="msgen">
         <term><command>msgen</command></term>
         <listitem>
-          <para>Creates an English translation catalog</para>
+          <para>创建英文翻译目录</para>
           <indexterm zone="ch-system-gettext msgen">
             <primary sortas="b-msgen">msgen</primary>
           </indexterm>
@@ -220,8 +219,7 @@ chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
       <varlistentry id="msgexec">
         <term><command>msgexec</command></term>
         <listitem>
-          <para>Applies a command to all translations of a translation
-          catalog</para>
+          <para>对翻译目录中的所有翻译执行命令</para>
           <indexterm zone="ch-system-gettext msgexec">
             <primary sortas="b-msgexec">msgexec</primary>
           </indexterm>
@@ -231,8 +229,7 @@ chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
       <varlistentry id="msgfilter">
         <term><command>msgfilter</command></term>
         <listitem>
-          <para>Applies a filter to all translations of a translation
-          catalog</para>
+          <para>对翻译目录中的所有翻译应用过滤器</para>
           <indexterm zone="ch-system-gettext msgfilter">
             <primary sortas="b-msgfilter">msgfilter</primary>
           </indexterm>
@@ -242,8 +239,7 @@ chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
       <varlistentry id="msgfmt">
         <term><command>msgfmt</command></term>
         <listitem>
-          <para>Generates a binary message catalog from a translation
-          catalog</para>
+          <para>根据翻译目录创建二进制消息目录</para>
           <indexterm zone="ch-system-gettext msgfmt">
             <primary sortas="b-msgfmt">msgfmt</primary>
           </indexterm>
@@ -253,8 +249,8 @@ chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
       <varlistentry id="msggrep">
         <term><command>msggrep</command></term>
         <listitem>
-          <para>Extracts all messages of a translation catalog that match a
-          given pattern or belong to some given source files</para>
+          <para>找出翻译目录中所有匹配给定模式,
+          	  或属于给定源代码文件的消息</para>
           <indexterm zone="ch-system-gettext msggrep">
             <primary sortas="b-msggrep">msggrep</primary>
           </indexterm>
@@ -264,9 +260,8 @@ chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
       <varlistentry id="msginit">
         <term><command>msginit</command></term>
         <listitem>
-          <para>Creates a new <filename class="extension">.po</filename> file,
-          initializing the meta information with values from the user's
-          environment</para>
+          <para>创建一个新的 <filename class="extension">.po</filename>
+			  文件,以用户环境中的值初始化其元信息</para>
           <indexterm zone="ch-system-gettext msginit">
             <primary sortas="b-msginit">msginit</primary>
           </indexterm>
@@ -276,7 +271,7 @@ chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
       <varlistentry id="msgmerge">
         <term><command>msgmerge</command></term>
         <listitem>
-          <para>Combines two raw translations into a single file</para>
+          <para>将两个原始翻译文件组合成一个文件</para>
           <indexterm zone="ch-system-gettext msgmerge">
             <primary sortas="b-msgmerge">msgmerge</primary>
           </indexterm>
@@ -286,8 +281,7 @@ chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
       <varlistentry id="msgunfmt">
         <term><command>msgunfmt</command></term>
         <listitem>
-          <para>Decompiles a binary message catalog into raw translation
-          text</para>
+          <para>反编译二进制消息目录,生成原始翻译文本</para>
           <indexterm zone="ch-system-gettext msgunfmt">
             <primary sortas="b-msgunfmt">msgunfmt</primary>
           </indexterm>
@@ -297,7 +291,7 @@ chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
       <varlistentry id="msguniq">
         <term><command>msguniq</command></term>
         <listitem>
-          <para>Unifies duplicate translations in a translation catalog</para>
+          <para>去除翻译目录中重复的翻译</para>
           <indexterm zone="ch-system-gettext msguniq">
             <primary sortas="b-msguniq">msguniq</primary>
           </indexterm>
@@ -307,8 +301,7 @@ chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
       <varlistentry id="ngettext">
         <term><command>ngettext</command></term>
         <listitem>
-          <para>Displays native language translations of a textual message whose
-          grammatical form depends on a number</para>
+          <para>显示某条语法形式依赖于数字的文本消息的母语翻译</para>
           <indexterm zone="ch-system-gettext ngettext">
             <primary sortas="b-ngettext">ngettext</primary>
           </indexterm>
@@ -318,7 +311,7 @@ chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
       <varlistentry id="recode-sr-latin">
         <term><command>recode-sr-latin</command></term>
         <listitem>
-          <para>Recodes Serbian text from Cyrillic to Latin script</para>
+          <para>将塞尔维亚语文本从西里尔字符转换为拉丁字符</para>
           <indexterm zone="ch-system-gettext recode-sr-latin">
             <primary sortas="b-recode-sr-latin">recode-sr-latin</primary>
           </indexterm>
@@ -328,8 +321,8 @@ chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
       <varlistentry id="xgettext">
         <term><command>xgettext</command></term>
         <listitem>
-          <para>Extracts the translatable message lines from the given source
-          files to make the first translation template</para>
+          <para>从给定源代码文件中提取可翻译消息,以生成最初的翻译模板
+          </para>
           <indexterm zone="ch-system-gettext xgettext">
             <primary sortas="b-xgettext">xgettext</primary>
           </indexterm>
@@ -339,10 +332,10 @@ chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
       <varlistentry id="libasprintf">
         <term><filename class="libraryfile">libasprintf</filename></term>
         <listitem>
-          <para>defines the <emphasis>autosprintf</emphasis> class, which makes
-          C formatted output routines usable in C++ programs, for use with the
-          <emphasis>&lt;string&gt;</emphasis> strings and the
-          <emphasis>&lt;iostream&gt;</emphasis> streams</para>
+          <para>定义 <emphasis>autosprintf</emphasis> 类,使得
+          C 格式化输出子程序在 C++ 程序中可用,能够与
+          <emphasis>&lt;string&gt;</emphasis> 字符串和
+          <emphasis>&lt;iostream&gt;</emphasis> 流一起使用</para>
           <indexterm zone="ch-system-gettext libasprintf">
             <primary sortas="c-libasprintf">libasprintf</primary>
           </indexterm>
@@ -352,8 +345,8 @@ chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
       <varlistentry id="libgettextlib">
         <term><filename class="libraryfile">libgettextlib</filename></term>
         <listitem>
-          <para>a private library containing common routines used by the
-          various Gettext programs; these are not intended for general use</para>
+          <para>一个私有库,包含若干 Gettext 程序的公共子程序;
+          不建议普遍使用</para>
           <indexterm zone="ch-system-gettext libgettextlib">
             <primary sortas="c-libgettextlib">libgettextlib</primary>
           </indexterm>
@@ -363,12 +356,12 @@ chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
       <varlistentry id="libgettextpo">
         <term><filename class="libraryfile">libgettextpo</filename></term>
         <listitem>
-          <para>Used to write specialized programs that process
-          <filename class="extension">.po</filename> files; this library is
-          used when the standard applications shipped with Gettext (such as
+          <para>用于编写处理
+          <filename class="extension">.po</filename> 文件的专用程序;
+          这个库在 Gettext 发行的标准程序 (如
           <command>msgcomm</command>, <command>msgcmp</command>,
-          <command>msgattrib</command>, and <command>msgen</command>) will
-          not suffice</para>
+          <command>msgattrib</command>, 以及 <command>msgen</command>)
+          不能满足要求时使用</para>
           <indexterm zone="ch-system-gettext libgettextpo">
             <primary sortas="c-libgettextpo">libgettextpo</primary>
           </indexterm>
@@ -378,8 +371,8 @@ chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
       <varlistentry id="libgettextsrc">
         <term><filename class="libraryfile">libgettextsrc</filename></term>
         <listitem>
-          <para>A private library containing common routines used by the
-          various Gettext programs; these are not intended for general use</para>
+          <para>一个私有库,包含若干 Gettext 程序使用的公共子程序;
+          没有设计为普遍使用</para>
           <indexterm zone="ch-system-gettext libgettextsrc">
             <primary sortas="c-libgettextsrc">libgettextsrc</primary>
           </indexterm>
@@ -389,9 +382,9 @@ chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
       <varlistentry id="preloadable_libintl">
         <term><filename class="libraryfile">preloadable_libintl</filename></term>
         <listitem>
-          <para>A library, intended to be used by LD_PRELOAD that assists
-          <filename class="libraryfile">libintl</filename> in logging
-          untranslated messages</para>
+          <para>一个被设计为由 LD_PRELOAD 预加载的库,帮助
+          <filename class="libraryfile">libintl</filename>
+          记录未翻译的消息</para>
           <indexterm zone="ch-system-gettext preloadable_libintl">
             <primary sortas="c-preloadable_libintl">preloadable_libintl</primary>
           </indexterm>