Browse Source

chapter06: Translate ninja instruction

Xi Ruoyao 7 years ago
parent
commit
4f06f3ff2b
1 changed files with 25 additions and 14 deletions
  1. 25 14
      chapter06/ninja.xml

+ 25 - 14
chapter06/ninja.xml

@@ -23,7 +23,7 @@
   <sect2 role="package">
   <sect2 role="package">
     <title/>
     <title/>
 
 
-    <para>Ninja is a small build system with a focus on speed.</para>
+    <para>Ninja 是一个注重速度的小型构建系统。</para>
 
 
     <segmentedlist>
     <segmentedlist>
       <segtitle>&buildtime;</segtitle>
       <segtitle>&buildtime;</segtitle>
@@ -38,43 +38,54 @@
   </sect2>
   </sect2>
 
 
   <sect2 role="installation">
   <sect2 role="installation">
-    <title>安装Ninja</title>
+    <title>安装 Ninja</title>
 
 
-    <para>When run, ninja normally runs a maximum number of processes
+    <!--para>When run, ninja normally runs a maximum number of processes
     in parallel.  By default this is the number of cores on the system 
     in parallel.  By default this is the number of cores on the system 
     plus two.  In some cases this can overheat a CPU or run a system out
     plus two.  In some cases this can overheat a CPU or run a system out
     of memory.  If run from the command line, passing a -jN parameter
     of memory.  If run from the command line, passing a -jN parameter
     will limit the number of parallel processes, but some packages
     will limit the number of parallel processes, but some packages
-    embed the execution of ninja and do not pass a -j parameter.</para>
-
-    <para>Using the <emphasis>optional</emphasis> patch below allows a user to
+    embed the execution of ninja and do not pass a -j parameter.</para-->
+    <para>在运行时, ninja 一般尽量并行运行更多进程,
+		默认情况下最大进程数是系统 CPI 核心数加 2 得到的值。
+		某些情况下,这样会导致 CPU 过热,或者耗尽系统内存。
+		如果使用命令行执行 ninja,可以传递 -jN 参数以限制并行进程数,
+		但某些软件包内嵌了 ninja 的执行过程,且并不传递 -j 参数。</para>
+
+    <!--para>Using the <emphasis>optional</emphasis> patch below allows a user to
     limit the number of parallel processes via an environment variable, 
     limit the number of parallel processes via an environment variable, 
-    NINJAJOBS.  <command>For example</command> setting:
+	NINJAJOBS.  <command>For example</command> setting: -->
+
+	<para>使用下面这个 <emphasis>可选的</emphasis> 补丁,
+		用户即可通过一个环境变量 NINJAJOBS 限制并行进程数量。
+		<command>例如</command> 设置:
 
 
      <!-- Using <command> here to make the output bold.  We really don't want
      <!-- Using <command> here to make the output bold.  We really don't want
      users setting this now and experience shows that many users blindly
      users setting this now and experience shows that many users blindly
      copy/paste anything in a box. -->
      copy/paste anything in a box. -->
+	 <!-- 这里的 <command> 标记用于加粗。我们确实不希望用户现在就设置
+		 该变量,过去的经验表明许多用户盲目地复制粘贴矩形框中的所有内容。
+		 译注:这可能是全书唯一一个被翻译的注释。-->
 
 
     <screen>export NINJAJOBS=4</screen>
     <screen>export NINJAJOBS=4</screen>
 
 
-    will limit ninja to four parallel processes.</para>
+    会限制 ninja 使用 4 个并行进程。</para>
 
 
-    <para>If desired, install the patch by running:</para>
+    <para>如果希望使用这个补丁,执行下列命令应用它:</para>
 
 
 <screen><userinput remap="pre">patch -Np1 -i ../ninja-1.8.2-add_NINJAJOBS_var-1.patch</userinput></screen>
 <screen><userinput remap="pre">patch -Np1 -i ../ninja-1.8.2-add_NINJAJOBS_var-1.patch</userinput></screen>
 
 
-    <para>Build Ninja with:</para>
+    <para>构建 Ninja:</para>
 
 
 <screen><userinput remap="configure">python3 configure.py --bootstrap</userinput></screen>
 <screen><userinput remap="configure">python3 configure.py --bootstrap</userinput></screen>
 
 
     <variablelist>
     <variablelist>
-      <title>The meaning of the build option:</title>
+      <title>构建选项的含义:</title>
 
 
       <varlistentry>
       <varlistentry>
         <term><parameter>--bootstrap</parameter></term>
         <term><parameter>--bootstrap</parameter></term>
         <listitem>
         <listitem>
-          <para>This parameter forces ninja to rebuild itself for the current
-          system.</para>
+          <para>这个参数强制 ninja 为当前系统重新构建自身。</para>
         </listitem>
         </listitem>
       </varlistentry>
       </varlistentry>
 
 
@@ -112,7 +123,7 @@ install -vDm644 misc/zsh-completion  /usr/share/zsh/site-functions/_ninja</useri
       <varlistentry id="ninja">
       <varlistentry id="ninja">
         <term><command>ninja</command></term>
         <term><command>ninja</command></term>
         <listitem>
         <listitem>
-          <para>is the Ninja build system.</para>
+          <para>是 ninja 构建系统</para>
           <indexterm zone="ch-system-ninja ninja">
           <indexterm zone="ch-system-ninja ninja">
             <primary sortas="b-ninja">ninja</primary>
             <primary sortas="b-ninja">ninja</primary>
           </indexterm>
           </indexterm>