Difference between revisions of "ZH/Translation PO File Approach"

From ADempiere
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.
 
(第四步 转化为xml文件)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=通往本地化翻译的自由之路=
+
[[ADempiere|<返回英文首页>]]    [[Chinese|<返回中文首页>]]    [[ZH/TranslationProject|<返回中文翻译项目首页>]]
 +
=通往国际化翻译的自由之路=
  
* po文档是目前开源软件的主流翻译模式。
+
* 本文主要介绍利用PO文件开展ADempiere翻译的总体工作流程。
* 无论采用哪一种翻译平台,采用.po文件的方式是现阶段国际上最为成熟的本地化翻译工具。
+
* 关于'''PO文件的示例、原理和使用方法'''见 [[ZH/Translation PO File Approach Detail|通往本地化翻译的自由之路-深入探寻]]。
* .po文件的使用原理的方法见这里。
+
* 本文尚在编辑完善中,欢迎您的参与!
==总体设想是==
+
 
* 把ERP数据里的导出为DocBook文件格式,接着转换为.po文件格式。
+
==总体设想==
* 关于DocBook文件格式,[http://www.worldhello.net/doc/docbook_howto/index.html 这里]有详细说明。
+
 
 +
* 翻译流程:
 +
 
 +
<pre>
 +
未翻译的.xml文档  ----->  未翻译的.po文档  ----->  已翻译的.po文档  ----->  已翻译的.xml文档
 +
                  ^                      ^                    ^
 +
              (自动处理)    (手工翻译或Launchpad协作翻译)      (自动处理)
 +
</pre>
 +
===翻译方法===
 +
* 对于po文档,有两种方式进行翻译。
 +
** 一是上传至翻译平台(如launchpad.net),在网站上完成翻译后导出。
 +
**二是直接在po文档中手工翻译。
 +
* 无论采用哪一种方式,经过翻译之后,最后po文件内容都是一致的,例如:
  
 
==目前需要着手的工作==
 
==目前需要着手的工作==
1、导出为DocBook文件格式的工具。
+
# 自动处理.xml文件格式的工具。
 +
# 已有中文翻译成果的整理。此项工作难度最大。
  
===.po文档的典型格式===
 
.po文档的典型格式是这样的,
 
  
  #. type: Name
+
=PO文件翻译流程=
   #: id="100"
+
* 在这里,我们结合ADempiere的实际例子,您将会看到如何围绕PO文件开展翻译工作的。
 +
===第一步 取得原始.xml文件===
 +
* 假设有一个未翻译的原始.xml文件:untrans.xml
 +
** 备注:本内容摘自AD_Window_Trl_en_US.xml
 +
 
 +
<pre>
 +
 
 +
<adempiereTrl language="en_US" table="AD_Window">
 +
<row id="100" trl="Y">
 +
  <value column="Name" original="Table and Column">Table and Column</value>
 +
  <value column="Description" original="Maintain Tables and Columns">Maintain Tables and Columns</value>
 +
  <value column="Help" original="The Table and Column Window defines all tables with their columns">The Table and Column Window defines all tables with their columns</value>
 +
</row>
 +
</adempiereTrl>
 +
</pre>
 +
 
 +
===第二步 转化为.po文件===
 +
* 通过po4a工具,自动将原始的XML文件转化为未翻译的PO文件:untrans.po,格式如下:
 +
 
 +
<pre>
 +
   #. id="100"
 +
  #: type: Name
 
   msgid "Table and Column"
 
   msgid "Table and Column"
 
   msgstr ""
 
   msgstr ""
  
   #. type: Description
+
   #. id="100"
  #: id="100"
+
  #: type: Description
 
   msgid "Maintain Tables and Columns"
 
   msgid "Maintain Tables and Columns"
 
   msgstr ""
 
   msgstr ""
  
   #. type: Help
+
   #. id="100"
  #: id="100"
+
  #: type: Help
 
   msgid "The Table and Column Window defines all tables with their columns"
 
   msgid "The Table and Column Window defines all tables with their columns"
 
   msgstr ""
 
   msgstr ""
  
==翻译方法==
+
</pre>
* 对于po文档,有两种方式进行翻译。
+
 
** 一是上传至翻译平台(如launchpad.net),在网站上完成翻译后导出。
+
 
**二是直接在po文档中手工翻译。
+
 
* 无论采用哪一种方式,经过翻译之后,最后po文件内容都是一致的,例如:
+
===第三步 翻译PO文件===
 +
* 通过文本编辑工具直接翻译PO文件。
 +
* 翻译完成后的.po文件文件名为: trans.po
  
  #. type: Name
+
<pre>
   #: id="100"
+
   #. id="100"
 +
  #: type: Name
 
   msgid "Table and Column"
 
   msgid "Table and Column"
 
   msgstr "表格和列"
 
   msgstr "表格和列"
  
   #. type: Description
+
   #. id="100"
  #: id="100"
+
  #: type: Description
 
   msgid "Maintain Tables and Columns"
 
   msgid "Maintain Tables and Columns"
 
   msgstr "维护表格和列"
 
   msgstr "维护表格和列"
  
   #. type: Help
+
   #. id="100"
  #: id="100"
+
  #: type: Help
 
   msgid "The Table and Column Window defines all tables with their columns"
 
   msgid "The Table and Column Window defines all tables with their columns"
   msgstr "这个表格和列窗体用于定义所有的表格和列"
+
   msgstr "这个 表格和列窗体 用于定义所有的表格和列"
 +
</pre>
 +
 
 +
===第四步 转化为xml文件===
 +
* po4a工具会把原始XML模板(untrans.xml)和已经翻译好的PO文件(trans.po)结合起来,自动生成翻译好的XML文件,这样就可以直接导入ADempiere ERP啦!
 +
* 翻译后的xml文件trans.xml,结果如下所示:
 +
 
 +
<pre>
 +
<adempiereTrl language="en_US" table="AD_Window">
 +
<row id="100" trl="Y">
 +
  <value column="Name" original="Table and Column">表格和列</value>
 +
  <value column="Description" original="Maintain Tables and Columns">维护表格和列</value>
 +
  <value column="Help" original="The Table and Column Window defines all tables with their columns">这个 表格和列窗体 用于定义所有的表格和列</value>
 +
</row>
 +
</adempiereTrl>
 +
</pre>
 +
 
 +
 
 +
[[Category:Chinese]]
 +
[[Category:Localisation]]
 +
[[Category:Translation Project]]

Latest revision as of 23:38, 3 June 2010

<返回英文首页> <返回中文首页> <返回中文翻译项目首页>

通往国际化翻译的自由之路

总体设想

  • 翻译流程:
未翻译的.xml文档  ----->  未翻译的.po文档  ----->  已翻译的.po文档  ----->  已翻译的.xml文档 
                  ^                      ^                     ^
              (自动处理)    (手工翻译或Launchpad协作翻译)      (自动处理)

翻译方法

  • 对于po文档,有两种方式进行翻译。
    • 一是上传至翻译平台(如launchpad.net),在网站上完成翻译后导出。
    • 二是直接在po文档中手工翻译。
  • 无论采用哪一种方式,经过翻译之后,最后po文件内容都是一致的,例如:

目前需要着手的工作

  1. 自动处理.xml文件格式的工具。
  2. 已有中文翻译成果的整理。此项工作难度最大。


PO文件翻译流程

  • 在这里,我们结合ADempiere的实际例子,您将会看到如何围绕PO文件开展翻译工作的。

第一步 取得原始.xml文件

  • 假设有一个未翻译的原始.xml文件:untrans.xml
    • 备注:本内容摘自AD_Window_Trl_en_US.xml

<adempiereTrl language="en_US" table="AD_Window">
 <row id="100" trl="Y">
  <value column="Name" original="Table and Column">Table and Column</value>
  <value column="Description" original="Maintain Tables and Columns">Maintain Tables and Columns</value>
  <value column="Help" original="The Table and Column Window defines all tables with their columns">The Table and Column Window defines all tables with their columns</value>
 </row>
</adempiereTrl>

第二步 转化为.po文件

  • 通过po4a工具,自动将原始的XML文件转化为未翻译的PO文件:untrans.po,格式如下:
   #. id="100"
   #: type: Name
   msgid "Table and Column"
   msgstr ""

   #. id="100"
   #: type: Description
   msgid "Maintain Tables and Columns"
   msgstr ""

   #. id="100"
   #: type: Help
   msgid "The Table and Column Window defines all tables with their columns"
   msgstr ""


第三步 翻译PO文件

  • 通过文本编辑工具直接翻译PO文件。
  • 翻译完成后的.po文件文件名为: trans.po
   #. id="100"
   #: type: Name
   msgid "Table and Column"
   msgstr "表格和列"

   #. id="100"
   #: type: Description
   msgid "Maintain Tables and Columns"
   msgstr "维护表格和列"

   #. id="100"
   #: type: Help
   msgid "The Table and Column Window defines all tables with their columns"
   msgstr "这个 表格和列窗体 用于定义所有的表格和列"

第四步 转化为xml文件

  • po4a工具会把原始XML模板(untrans.xml)和已经翻译好的PO文件(trans.po)结合起来,自动生成翻译好的XML文件,这样就可以直接导入ADempiere ERP啦!
  • 翻译后的xml文件trans.xml,结果如下所示:
<adempiereTrl language="en_US" table="AD_Window">
 <row id="100" trl="Y">
  <value column="Name" original="Table and Column">表格和列</value>
  <value column="Description" original="Maintain Tables and Columns">维护表格和列</value>
  <value column="Help" original="The Table and Column Window defines all tables with their columns">这个 表格和列窗体 用于定义所有的表格和列</value>
 </row>
</adempiereTrl>