Jelajahi Sumber

chapter06: Translate ncurses instruction

The duplicated configure option was removed from chapter05.
Xi Ruoyao 7 tahun lalu
induk
melakukan
86c3269807
2 mengubah file dengan 78 tambahan dan 61 penghapusan
  1. 3 8
      chapter05/ncurses.xml
  2. 75 53
      chapter06/ncurses.xml

+ 3 - 8
chapter05/ncurses.xml

@@ -99,14 +99,9 @@
           traditional 8-bit locales, while normal libraries work properly
           only in 8-bit locales. Wide-character and normal libraries are
           source-compatible, but not binary-compatible.</para-->
-	      <para>该选项使得宽字符库(例如
-<filename class="libraryfile">libncursesw.so.&ncurses-version;</filename> )
-被构建,而不构建常规字符库(例如
-<filename class="libraryfile">libncurses.so.&ncurses-version;</filename>)。
-宽字符库在多字节和传统 8 位 locale 中都能工作,
-而常规字符库只能在 8 位 locale 中工作。
-宽字符库和普通字符库在源码层面是兼容的,但二进制不兼容。</para>
-
+		  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
+		  href="../chapter06/ncurses.xml"
+		  xpointer="xpointer(//*[@os='widec'])"/>
         </listitem>
       </varlistentry>
 

+ 75 - 53
chapter06/ncurses.xml

@@ -23,8 +23,7 @@
   <sect2 role="package">
     <title/>
 
-    <para>The Ncurses package contains libraries for terminal-independent
-    handling of character screens.</para>
+    <para>Ncurses 软件包包含终端无关的字符屏幕处理库。</para>
 
     <segmentedlist>
       <segtitle>&buildtime;</segtitle>
@@ -39,9 +38,10 @@
   </sect2>
 
   <sect2 role="installation">
-    <title>安装Ncurses</title>
+    <title>安装 Ncurses</title>
 
-    <para>Don't install a static library that is not handled by configure:</para>
+	<para>输入下列命令,使构建系统不安装一个 configure 脚本未处理的静态库:
+	</para>
 
 <screen><userinput remap="pre">sed -i '/LIBTOOL_INSTALL/d' c++/Makefile.in</userinput></screen>
 
@@ -56,26 +56,34 @@
             --enable-widec</userinput></screen>
 
     <variablelist>
-      <title>The meaning of the new configure options:</title>
+      <title>新的配置选项的含义:</title>
 
       <varlistentry>
         <term><parameter>--enable-widec</parameter></term>
         <listitem>
-          <para>This switch causes wide-character libraries (e.g., <filename
+          <!--para>This switch causes wide-character libraries (e.g., <filename
           class="libraryfile">libncursesw.so.&ncurses-version;</filename>)
           to be built instead of normal ones (e.g., <filename
           class="libraryfile">libncurses.so.&ncurses-version;</filename>).
           These wide-character libraries are usable in both multibyte and
           traditional 8-bit locales, while normal libraries work properly
           only in 8-bit locales. Wide-character and normal libraries are
-          source-compatible, but not binary-compatible.</para>
+          source-compatible, but not binary-compatible.</para-->
+	      <para os="widec">该选项使得宽字符库(例如
+<filename class="libraryfile">libncursesw.so.&ncurses-version;</filename> )
+被构建,而不构建常规字符库(例如
+<filename class="libraryfile">libncurses.so.&ncurses-version;</filename>)。
+宽字符库在多字节和传统 8 位 locale 中都能工作,
+而常规字符库只能在 8 位 locale 中工作。
+宽字符库和普通字符库在源码层面是兼容的,但二进制不兼容。</para>
+
         </listitem>
       </varlistentry>
 
       <varlistentry>
         <term><parameter>--enable-pc-files</parameter></term>
         <listitem>
-          <para>This switch generates and installs .pc files for pkg-config.
+          <para>该参数使得构建系统生成并安装 pkg-config 使用的 .pc 文件。
           </para>
         </listitem>
       </varlistentry>
@@ -83,7 +91,7 @@
       <varlistentry>
         <term><parameter>--without-normal</parameter></term>
         <listitem>
-          <para>This switch disables building and installing most static libraries.
+          <para>该选项禁止构建系统编译并安装多数静态库。
           </para>
         </listitem>
       </varlistentry>
@@ -94,30 +102,34 @@
 
 <screen><userinput remap="make">make</userinput></screen>
 
-    <para>This package has a test suite, but it can only be run after the
+    <!--para>This package has a test suite, but it can only be run after the
     package has been installed.  The tests reside in the
     <filename class="directory">test/</filename> directory.  See the
     <filename>README</filename> file in that directory for further details.
-    </para>
+    </para-->
+	<para>该软件包有测试套件,但只能在安装该软件包后才能运行。
+		测试用例位于 <filename class="directory">test/</filename> 中,
+		阅读其中的 <filename>README</filename> 文件了解更多细节。</para>
 
     <para>安装该软件包:</para>
 
 <screen><userinput remap="install">make install</userinput></screen>
 
-    <para>Move the shared libraries to the
-    <filename class="directory">/lib</filename> directory, where they are
-    expected to reside:</para>
+    <para>将共享库移动到期望的
+    <filename class="directory">/lib</filename> 目录:</para>
 
 <screen><userinput remap="install">mv -v /usr/lib/libncursesw.so.6* /lib</userinput></screen>
 
-    <para>Because the libraries have been moved, one symlink points to
-    a non-existent file. Recreate it:</para>
+    <para>由于共享库被移走了,一个符号链接指向了不存在的文件。
+    重新创建它:</para>
 
 <screen><userinput remap="install">ln -sfv ../../lib/$(readlink /usr/lib/libncursesw.so) /usr/lib/libncursesw.so</userinput></screen>
 
-    <para>Many applications still expect the linker to be able to find
+    <!--para>Many applications still expect the linker to be able to find
     non-wide-character Ncurses libraries. Trick such applications into linking with
-    wide-character libraries by means of symlinks and linker scripts:</para>
+    wide-character libraries by means of symlinks and linker scripts:</para-->
+    <para>许多程序仍然希望链接器能够找到非宽字符版本的 Ncurses 库。
+		通过使用符号链接和链接脚本,诱导它们链接到宽字符库:</para>
 
 <screen><userinput remap="install">for lib in ncurses form panel menu ; do
     rm -vf                    /usr/lib/lib${lib}.so
@@ -125,28 +137,33 @@
     ln -sfv ${lib}w.pc        /usr/lib/pkgconfig/${lib}.pc
 done</userinput></screen>
 
-    <para>Finally, make sure that old applications that look for
-    <filename class="libraryfile">-lcurses</filename> at build time are still
-    buildable:</para>
+    <para>最后,确保那些在构建时寻找
+	<filename class="libraryfile">-lcurses</filename>
+    的老式程序仍然能够构建:</para>
 
 <screen><userinput remap="install">rm -vf                     /usr/lib/libcursesw.so
 echo "INPUT(-lncursesw)" &gt; /usr/lib/libcursesw.so
 ln -sfv libncurses.so      /usr/lib/libcurses.so</userinput></screen>
 
-    <para>If desired, install the Ncurses documentation:</para>
+    <para>如果需要的话,安装 Ncurses 文档:</para>
 
 <screen><userinput remap="install">mkdir -v       /usr/share/doc/ncurses-&ncurses-version;
 cp -v -R doc/* /usr/share/doc/ncurses-&ncurses-version;</userinput></screen>
 
     <note>
 
-      <para>The instructions above don't create non-wide-character Ncurses
+      <!--para>The instructions above don't create non-wide-character Ncurses
       libraries since no package installed by compiling from sources would link
       against them at runtime. However, the only known binary-only
       applications that link against non-wide-character Ncurses libraries 
       require version 5.  If you must have such libraries because of some binary-only
       application or to be compliant with LSB, build the package again with the
-      following commands:</para>
+      following commands:</para-->
+      <para>上述指令没有创建非宽字符的 Ncurses 库,
+		  因为从源码编译的软件包不会在运行时链接到它。
+		  然而,已知的需要链接到非宽字符 Ncurses 库的二进制程序都需要版本
+		  5,如果您为了满足一些仅有二进制版本的程序,或者满足 LSB 兼容性,
+		  必须安装这样的库,执行下列命令再次构建该软件包:</para>
 
 <screen role="nodump"><userinput>make distclean
 ./configure --prefix=/usr    \
@@ -171,29 +188,29 @@ cp -av lib/lib*.so.5* /usr/lib</userinput></screen>
 
       <seglistitem>
         <seg>
-           captoinfo (link to tic), 
+           captoinfo (链接到 tic), 
            clear, 
            infocmp, 
-           infotocap (link to tic),
+           infotocap (链接到 tic),
            ncursesw6-config, 
-           reset (link to tset), 
+           reset (链接到 tset), 
            tabs, 
            tic, 
            toe, 
-           tput, and 
+           tput, 以及
            tset
         </seg>
         <seg>
-           libcursesw.so (symlink and linker script to libncursesw.so),
+           libcursesw.so (指向 libncursesw.so 的符号链接和链接脚本),
            libformw.so, 
            libmenuw.so, 
            libncursesw.so,
            libncurses++w.a,
-           libpanelw.so, and their non-wide-character counterparts without "w"
-              in the library names.</seg>
+		   libpanelw.so, 以及它们的库名称没有 <quote>w</quote>
+		   的非宽字符替代品</seg>
         <seg>
            /usr/share/tabset, 
-           /usr/share/terminfo, and
+           /usr/share/terminfo, 以及
            /usr/share/doc/ncurses-&ncurses-version;
         </seg>
       </seglistitem>
@@ -207,7 +224,7 @@ cp -av lib/lib*.so.5* /usr/lib</userinput></screen>
       <varlistentry id="captoinfo">
         <term><command>captoinfo</command></term>
         <listitem>
-          <para>Converts a termcap description into a terminfo description</para>
+          <para>将 termcap 描述转换成 terminfo 描述</para>
           <indexterm zone="ch-system-ncurses captoinfo">
             <primary sortas="b-captoinfo">captoinfo</primary>
           </indexterm>
@@ -217,7 +234,7 @@ cp -av lib/lib*.so.5* /usr/lib</userinput></screen>
       <varlistentry id="clear">
         <term><command>clear</command></term>
         <listitem>
-          <para>Clears the screen, if possible</para>
+          <para>如果可能的话,清空屏幕</para>
           <indexterm zone="ch-system-ncurses clear">
             <primary sortas="b-clear">clear</primary>
           </indexterm>
@@ -227,7 +244,7 @@ cp -av lib/lib*.so.5* /usr/lib</userinput></screen>
       <varlistentry id="infocmp">
         <term><command>infocmp</command></term>
         <listitem>
-          <para>Compares or prints out terminfo descriptions</para>
+          <para>比较或输出 terminfo 描述</para>
           <indexterm zone="ch-system-ncurses infocmp">
             <primary sortas="b-infocmp">infocmp</primary>
           </indexterm>
@@ -237,7 +254,7 @@ cp -av lib/lib*.so.5* /usr/lib</userinput></screen>
       <varlistentry id="infotocap">
         <term><command>infotocap</command></term>
         <listitem>
-          <para>Converts a terminfo description into a termcap description</para>
+          <para>将 terminfo 描述转化为 termcap 描述</para>
           <indexterm zone="ch-system-ncurses infotocap">
             <primary sortas="b-infotocap">infotocap</primary>
           </indexterm>
@@ -247,7 +264,7 @@ cp -av lib/lib*.so.5* /usr/lib</userinput></screen>
       <varlistentry id="ncursesw6-config">
         <term><command>ncursesw6-config</command></term>
         <listitem>
-          <para>Provides configuration information for ncurses</para>
+          <para>提供 ncurses 的配置信息</para>
           <indexterm zone="ch-system-ncurses ncursesw6-config">
             <primary sortas="b-ncursesw6-config">ncursesw6-config</primary>
           </indexterm>
@@ -257,7 +274,7 @@ cp -av lib/lib*.so.5* /usr/lib</userinput></screen>
       <varlistentry id="reset">
         <term><command>reset</command></term>
         <listitem>
-          <para>Reinitializes a terminal to its default values</para>
+          <para>以终端默认值重新初始化终端</para>
           <indexterm zone="ch-system-ncurses reset">
             <primary sortas="b-reset">reset</primary>
           </indexterm>
@@ -267,7 +284,7 @@ cp -av lib/lib*.so.5* /usr/lib</userinput></screen>
       <varlistentry id="tabs">
         <term><command>tabs</command></term>
         <listitem>
-          <para>Clears and sets tab stops on a terminal</para>
+          <para>清除并设置终端的 tab 宽度</para>
           <indexterm zone="ch-system-ncurses tabs">
             <primary sortas="b-tabs">tabs</primary>
           </indexterm>
@@ -277,10 +294,13 @@ cp -av lib/lib*.so.5* /usr/lib</userinput></screen>
       <varlistentry id="tic">
         <term><command>tic</command></term>
         <listitem>
-          <para>The terminfo entry-description compiler that translates a
+          <!--para>The terminfo entry-description compiler that translates a
           terminfo file from source format into the binary format needed for the
           ncurses library routines [A terminfo file contains information on the
-          capabilities of a certain terminal.]</para>
+          capabilities of a certain terminal.]</para-->
+	      <para>Terminfo 条目描述编译器,将 terminfo
+			  文件从源代码格式翻译为 ncurses 库子程序需要的二进制格式
+			  [terminfo 文件包含特定终端的功能信息。]</para>
           <indexterm zone="ch-system-ncurses tic">
             <primary sortas="b-tic">tic</primary>
           </indexterm>
@@ -290,8 +310,8 @@ cp -av lib/lib*.so.5* /usr/lib</userinput></screen>
       <varlistentry id="toe">
         <term><command>toe</command></term>
         <listitem>
-          <para>Lists all available terminal types, giving the primary name and
-          description for each</para>
+          <para>列出所有可用的终端类型,并给出每种类型的主要名称和描述
+          </para>
           <indexterm zone="ch-system-ncurses toe">
             <primary sortas="b-toe">toe</primary>
           </indexterm>
@@ -301,9 +321,8 @@ cp -av lib/lib*.so.5* /usr/lib</userinput></screen>
       <varlistentry id="tput">
         <term><command>tput</command></term>
         <listitem>
-          <para>Makes the values of terminal-dependent capabilities available to
-          the shell; it can also be used to reset or initialize a terminal or
-          report its long name</para>
+          <para>使 shell 可以使用终端相关的功能;也可以重置或初始化终端,
+          或者报告它的长名称</para>
           <indexterm zone="ch-system-ncurses tput">
             <primary sortas="b-tput">tput</primary>
           </indexterm>
@@ -313,7 +332,7 @@ cp -av lib/lib*.so.5* /usr/lib</userinput></screen>
       <varlistentry id="tset">
         <term><command>tset</command></term>
         <listitem>
-          <para>Can be used to initialize terminals</para>
+          <para>可以被用于初始化终端</para>
           <indexterm zone="ch-system-ncurses tset">
             <primary sortas="b-tset">tset</primary>
           </indexterm>
@@ -323,7 +342,7 @@ cp -av lib/lib*.so.5* /usr/lib</userinput></screen>
       <varlistentry id="libcursesw">
         <term><filename class="libraryfile">libcursesw</filename></term>
         <listitem>
-          <para>A link to <filename>libncursesw</filename></para>
+          <para>指向 <filename>libncursesw</filename> 的链接</para>
           <indexterm zone="ch-system-ncurses libcursesw">
             <primary sortas="c-libcursesw">libcursesw</primary>
           </indexterm>
@@ -333,10 +352,13 @@ cp -av lib/lib*.so.5* /usr/lib</userinput></screen>
       <varlistentry id="libncursesw">
         <term><filename class="libraryfile">libncursesw</filename></term>
         <listitem>
-          <para>Contains functions to display text in many complex ways on a
+          <!--para>Contains functions to display text in many complex ways on a
           terminal screen; a good example of the use of these functions is the
           menu displayed during the kernel's <command>make
-          menuconfig</command></para>
+          menuconfig</command></para-->
+          <para>包含在终端屏幕上以多种复杂方式显示文本的函数;
+			  使用这些函数的典型例子是运行内核的
+			  <command>make menuconfig</command> 时显示的目录。</para>
           <indexterm zone="ch-system-ncurses libncursesw">
             <primary sortas="c-libncursesw">libncursesw</primary>
           </indexterm>
@@ -346,7 +368,7 @@ cp -av lib/lib*.so.5* /usr/lib</userinput></screen>
       <varlistentry id="libformw">
         <term><filename class="libraryfile">libformw</filename></term>
         <listitem>
-          <para>Contains functions to implement forms</para>
+          <para>包含实现表单的函数</para>
           <indexterm zone="ch-system-ncurses libformw">
             <primary sortas="c-libformw">libformw</primary>
           </indexterm>
@@ -356,7 +378,7 @@ cp -av lib/lib*.so.5* /usr/lib</userinput></screen>
       <varlistentry id="libmenuw">
         <term><filename class="libraryfile">libmenuw</filename></term>
         <listitem>
-          <para>Contains functions to implement menus</para>
+          <para>包含实现目录的函数</para>
           <indexterm zone="ch-system-ncurses libmenuw">
             <primary sortas="c-libmenuw">libmenuw</primary>
           </indexterm>
@@ -366,7 +388,7 @@ cp -av lib/lib*.so.5* /usr/lib</userinput></screen>
       <varlistentry id="libpanelw">
         <term><filename class="libraryfile">libpanelw</filename></term>
         <listitem>
-          <para>Contains functions to implement panels</para>
+          <para>包含实现面板的函数</para>
           <indexterm zone="ch-system-ncurses libpanelw">
             <primary sortas="c-libpanelw">libpanelw</primary>
           </indexterm>