Convert Simplified Chinese to Traditional Chinese in a Drupal Project

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:

  1. 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.
  2. Use mysqldump to dump out the content of the website.
  3. Create a new database and import what you just dumped out from the production database into the new database.
  4. 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.
  5. In the new database, empty the table sessions.
  6. Use mysqldump again to dump out the content of the new database. Say you name your DB dump output file as mydb.sql.
  7. 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.)
  8. Re-import the new DB file mydb.b.sql into your new database.
  9. Enable the locale of Traditional Chinese, and import the Drupal translation.
  10. 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

thanks. i used to to convert

thanks. i used to to convert simplified chinese to traditional.