If you have a Drupal website in Simplified Chinese, and now you want to to convert it into Traditional Chinese, or the other way around, here is how you can do it:
- Install the perl module Encode::HanConvert, which comes with two command line utilities: g2b.pl and b2g.pl. g2b.pl is for converting from Simplified Chinese into Traditional Chinese. b2g.pl is for converting from Traditional Chinese into Simplified Chinese.
- Use mysqldump to dump out the content of the website.
- Create a new database and import what you just dumped out from the production database into the new database.
- In the new database, empty the tables cache, cache_content (from CCK module), cache_filter, cache_menu, cache_page, cache_block (from blockcache module), cache_views (from views module), and other cache tables that you have.
- In the new database, empty the table sessions.
- Use mysqldump again to dump out the content of the new database. Say you name your DB dump output file as mydb.sql.
- Run the script g2b.pl or b2g.pl on your DB dump file like this:
g2b.pl -pu < mydb.sql > mydb.b.sql
(Substitute g2b.pl with g2g.pl if you are converting into Simplified Chinese.)
- Re-import the new DB file mydb.b.sql into your new database.
- Enable the locale of Traditional Chinese, and import the Drupal translation.
- Examine your theme functions and make sure any Simplified Chinese are changed to Traditional Chinese via a text editor.
Now you have completed the task.
Comments
Anonymous
February 13, 2009
1 year 29 weeks
thanks. i used to to convert
thanks. i used to to convert simplified chinese to traditional.