Last modified by: Peanut Blake, Jul 18, 2010
Created by: Peanut Blake. May 01, 2010
You can see latest help updated in: http://www.adempiere.com/index.php/Tool4po_help
Version of this readme file
Version: 0.97
Last update: July 18, 2010. By Peanut Blake
Created by Peanut Blake, May 2010.
Step 1: Download and install python3.1 ( or above ).
Debian/Linux:
# apt-get install python3.1
Fedora:
# yum install python3
Step 2: Download and install po4a
Debian/Linux:
# apt-get install po4a
Fedora:
# yum install po4a
ATTENTION:
ONLY Linux version is available yet. So that some functions of tool4po related with po4a cannot run under MS Windows.
Step 3: Create & access the work dir
Windows:
$ mkdir D:\tool4po\
$ cd D:\tool4po\
Linux:
$ mkdir /home/tool4po
$ cd /home/tool4po
Step 4: Release tool4po to work dir
Copy following files of tool4po to work dir:
tool4po.py
config.xml
system.xml
Step 5: Config parameter to meet your needs
1. Open 'config.xml'
2. Modify the parameter in 'config.xml'
2.1. For normal users, please pay attention to <default-language>.
2.2. For translation local leader, please pay attention to:
a. <default-language>.
b. <language>. For east-asian languages, please use "method='pattern'". For western languages, please use "method='compare'".
c. <head-po>.
3. Save file in 'UTF-8' charset format.
Generate translation list from existing translation packages.
e.g. , get file 'list_trans_zh_CN.xml' from folder 'zh_CN' which is already having Chinese translations.
This step is to take advantage of existing translations, so that you don't have to re-translation all texts.
ATTENTION: Please use the en_US language package in the official wiki page: http://www.adempiere.com/index.php/TranslationProject . Otherwise you may get some translation missing. Because the en_US exported from ADempiere ERP database contains format like "<![CDATA[&Menu]]>".
Command:
$ python3.1 tool4po.py --get-xml [folder en_US xml] [folder po translated] [folder xml translated output]
Example:
$ python3.1 tool4po.py --get-xml 'en_US' 'po_zh_CN' 'xml_zh_CN'
Details in process:
step 1: Format convert: PO -> XML-AD.
( 'en_US' + 'po_zh_CN' --> 'xml_zh_CN_tmp' )
( 'zh_CN' -> 'zh_CN_4po' )
step 2: Get formal XML-AD files
( 'xml_zh_CN_tmp' --> 'xml_zh_CN' )
Generate translation list from existing translation packages.
e.g. , get file 'list_trans_zh_CN.xml' from folder 'zh_CN' which is already having Chinese translations.
This step is to take advantage of existing translations, so that you don't have to re-translation all texts.
Command:
$ python3.1 tool4po.py --get-list-trans [folder en_US] [folder lang] [file output]
Example:
$ python3.1 tool4po.py --get-list-trans 'en_US' 'zh_CN' 'list_trans.xml'
Details in process:
step 1: XML-format convert: XML-AD -> XML-4PO.
( 'en_US' -> 'en_US_4po' )
( 'zh_CN' -> 'zh_CN_4po' )
step 2: Get Original - Translation pairs by matching IDs & tags.
( 'en_US_4po' & 'zh_CN_4po' -> 'list_trans_zh_CN.xml' )
Generate PO files. These files can be uploaded to Launchpad.net.
Command:
$ python3.1 tool4po.py --get-po [file trans] [folder POT] [folder output]
Example:
$ python3.1 tool4po.py --get-po 'list_trans.xml' 'pot' 'po'
Details in process:
step 1: XML-format convert: XML-MIX -> XML-SNG.
( 'list_trans.xml' -> 'list_trans_en_US.xml' )
( 'list_trans.xml' -> 'list_trans_en_US.xml' )
step 2: Get 'list_trans.po' by 'po4a-gettextize'.
step 3. Generate .PO files. 'list_trans.po' & 'pot' -> 'po'.
step 4. Re-organize .PO files in the format accepted by Launchpad.net.
step 5. msgfmt. check format of .po files
This function is useful if you have different xml translation packages from different people.
If you don't need it, please ignore it and skip this step.
In this case, you can use "--get-list-trans" and "--get-po" for each translated xml packages.
This function merges all the po files in the folder into 1 po file.
Command:
$ python3.1 tool4po.py --po-merge [folder po] [file po output]
Example:
$ python3.1 tool4po.py --po-merge 'po-pool' 'list_trans.po'
Generate packages, which can be uploaded to Launchpad.net.
Command:
$ python3.1 tool4po.py --get-list-trans [folder input] [folder output] [type]
Example:
$ python3.1 tool4po.py --get-list-trans 'po' 'po_lp' 'po'
Tidy the format of en_US XML files (XML-AD).
This function is especially for <![CDATA[&Menu]]>.
Command:
$ python3.1 tool4po.py --tidy-xml [source folder] [target folder]
Example:
$ python3.1 tool4po.py --tidy-xml 'en_US' 'en_US_tidy'
Generate POT template files from 'en_US' xml files.
.POT files are to be uploaded to Launchpad.net as templates.
Command:
$ python3.1 tool4po.py --get-pot [folder en_US] [folder output]
Example:
$ python3.1 tool4po.py --get-pot 'en_US' 'pot'
Details in process:
step 1: XML-format convert: XML-AD -> XML-4PO. ( 'en_US' -> 'en_US_4po' )
step 2: Convert: XML-4PO -> .POT. by po4a-gettextize. ( 'en_US_4po' -> 'pot_tmp' )
step 3. Reorganize POT file. ( 'pot_tmp' -> 'pot' )
step 4. msgfmt. check format of .pot files
Generate packages, which can be uploaded to Launchpad.net.
Command:
$ python3.1 tool4po.py --get-list-trans [folder input] [folder output] [type]
Example:
$ python3.1 tool4po.py --get-list-trans 'pot' 'pot_lp' 'pot'
Attention:
[type] option: 'pot' / 'po'
the package formats are different between *.POT files & *.PO files.
Mile stone of tool4po:
Mile Stone 08: 0.98a, Aug 02, 2010. Enhanced the remark information in POT files.
Mile Stone 07: 0.97a, Jul 18, 2010. 1. Using en_US standard package. 2. Support pot_remark. 3. Function: --tidy-xml.
Mile Stone 06: 0.96a, Jun 25, 2010. 1. Function: --get-xml. 2. Support western languages such as German.
Mile Stone 05: 0.95a, Jun 02, 2010. Finished rewriting in Object-Orient method
Mile Stone 04: 0.94a, May 09, 2010. Rewrite in Object-Orient method
Mile Stone 03: 0.93a, Apr 17, 2010. Complete: --msgfmt, --lp-package.
Mile Stone 02: 0.92a, Apr 16, 2010. Complete: --get-pot.
Mile Stone 01: 0.89a, Mar 16, 2010.
This is the end of the file.