ZH/Translation PO File Approach

From ADempiere
Revision as of 09:11, 5 February 2010 by Peanutblake (Talk) (通往国际化翻译的自由之路)

Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.

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

总体设想

  • 翻译流程:
未翻译的.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文件

  • 转化为未翻译的文件: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文件

  • 文件名为: 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文件

  • 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>