Development

Chinese / Hong Kong / Taiwan word conversion script

History

This is a pair of scripts, available on GNOME subversion repository. Staying on GNOME subversion means these 2 scripts are originally intended for converting between Hong Kong (zh_HK) and Taiwan (zh_TW) translations. Actually, these scripts are taken from en_GB conversion script, which converts source code (most usually in American English) translatable string into English flavour.

Indeed, these Perl scripts are no-brainers, what they do is just applying regular expression and performing replacement of words, so they are really slow on large files. But some little enhancements are done:

  • Can ask question in case of multiple possible conversion (also inherited from en_GB script, but original one only askes a yes/no question)
  • If specific po file translation comment is added before a certain msgid, then no more question will be asked, and it uses the translation available inside comment

Usage

Right now it can only read stdin, and pipes the result through stdout:

hk2tw.pl < zh_HK.po > zh_TW.po
tw2hk.pl < zh_TW.po > zh_HK.po

Leave a Reply

E-mail is not disclosed nor shared. Required fields are marked *