A front end in emacs to convert between simplified and traditional Chinese with opencc or cconv.
Author: Cong Gu
Have either opencc or cconv installed in your system.
Use MELPA
M-xpackage-installRETchinese-convRET
Put the following into init file (e.g. ~/.emacs)
(require 'chinese-conv)Put chinese-conv.el into desired location (e.g. ~/.emacs/site-lisp/)
and put the following into init file (e.g. ~/.emacs)
(add-to-list 'load-path "~/.emacs.d/site-lisp")
(require 'chinese-conv)Chinese-conv comes with support for opencc and cconv as backends.
To change opencc program path, set chinese-conv-opencc-program (default: "opencc"),
(setq chinese-conv-opencc-program "/PATH/TO/BIN/opencc")To change opencc data directory, set chinese-conv-opencc-data (default: "/usr/share/opencc/"),
(setq chinese-conv-opencc-data "/PATH/TO/DATA/")Set the backend to cconv,
(setq chinese-conv-backend "cconv")To change cconv program path, set chinese-conv-cconv-program (default: "cconv"),
(setq chinese-conv-cconv-program "/PATH/TO/BIN/cconv")Example:
M-xchinese-convRET后天RETtraditionalRET
后天 is the string to convert. The interactive command will guess it
from marked region or current word.
traditional is the conversion type. It is read with completion among all the
available types. Hit TAB for a complete list of available types.
The result will be displayed in minibuffer.
Example: Mark the region to be converted in the buffer, then
M-xchinese-conv-replaceRETtraditionalRET
The marked region will be converted to traditional characters.
(chinese-conv "后天" "traditional")
=> "後天"Backend can be explicitly specified,
(chinese-conv "后天" "traditional" "opencc")
=> "後天"