new thread title: how to translate Emacs menu to other languages
old thread title: show Emacs menu in your mother language
-----------------
with the following method, you can translate Emacs menu to any languages.
now zh_CN is OK. Both linux and Windows are ok.
----------------
if your Chinese is good, or you have some Chinese friends, see below for more: (in Chinese Simpified)
* Emacs中文菜单汉化包deb下载(emacs-locale-zh-cn.deb)
http://forum.ubuntu.org.cn/viewtopic.php?f=17&t=212467
directly download .deb from here:
2012.7.16 updated,
for Emacs 21.x - 24.1 for Ubuntu/Debian/LinuxMint
emacs-locale-zh-cn_24.1-1~careone8_all.deb [729.65 KiB]
http://forum.ubuntu.org.cn/download/file.php?id=160198 (.deb directly download)
for Emacs 23.4/ 24.1 for Windows/Linux
2012.7.17 updated,
* fit for Emacs 23.4/24.1 for windows;
* fit for Emacs 21.x--24.x for Linux
emacs-locale-zh-cn4win-linux.v9.zip [968.59 KiB]
http://forum.ubuntu.org.cn/download/file.php?id=160258 (.zip directly download)
|
Quote:
|
[2012/7/16 updated]
* maybe fit Emacs 21.x -- 24.x for Linux (.deb);
switch emacs menu with following options:
|
Code:
|
sudo emacs-locale-zh-cn --m1 | --m2 | --en |
ChangeLog for emacs-locale-zh-cn
emacs-locale-zh-cn
version: 24.1-1~careone8
2012/7/16 updated by Careone <careone@139.com>
FUNCTION
* add emacs-locale-zh-cn command to switch to Chinese with option:
--m1 active Scheme 1 for translated menu;
--m2 active Scheme 2 for translated menu;
--en return English menu (disable translated files and settings);
command full path: /usr/local/bin/emacs-locale-zh-cn
(note: you can modify/update this command file to fit your mother language on your will)
Scheme 1:
|
Code:
|
sudo emacs-locale-zh-cn --m1 |
use english.el + chinese-menu.el + mule-menu.el
test pass: Emacs 22.x - 24.x;
--------------
* Scheme 2:
|
Code:
|
sudo emacs-locale-zh-cn --m2 |
use translated lisp/menu-bar.el
testted pass/ not pass:
-- Emacs 23.1/Ubuntu 10.04 : testted pass;
-- Emacs 24.1 : not testted yet;
-- Emacs 22.3 : not pass (supportted terrible);
-- other Emacs versions: not testted yet;
--------------
|
Quote:
|
known bugs:
* some submenu display in English yet;
* lisp/facemenu.el submenu displasy in English yet;
* lisp/bookmark.el not work;
* lisp/ediff-hook.el not work;
* Emacs 23.1/Ubuntu 10.04 , enable --m1 or --m2, game
tetris display some spinned blank lines (but Emacs for Windows works ok);
* Emacs for Windows: some translated menu show bad codings (but tips show well);
|
file/dir adjustment:
* translate file *.el (s) and place them to dir:
/usr/share/emacs/$VERSION/site-lisp/zh_CN/lisp/
just as where them from (compatible for multi versions and multi languages support well);
TODO
* more lisp/*/*.el files need be translated;
|
|
Quote:
|
|
Code:
|
$ emacs-locale-zh-cn -h |
Usage: /usr/local/bin/emacs-locale-zh-cn [OPTION]
toggle Emacs locale to Chinese Simipified (zh_CN) with 2 different methods:
use "chinese-menu.el" or "menu-bar.el"
-a, --auto equals [ --chinese-menu ], recommended (root please) *
--m1, --chinese-menu toggle locale to zh_CN with chinese-menu.el
and some others (root please)
--m2, --menu-bar toggle locale to zh_CN with menu-bar.el
and some others (root please)
--en, --english restore locale to en_US (root please)
-l, --list list supportted Emacs versions and extra options
-v, --version print the version information and exit
-h, --help print this message and exit
|
TECH ANALYSIS
;;; PART 1: for Linux/freebsd/pcbsd
;;; STEP 1: mkdir as root
;;; below is shown for language zh_CN,*
;;; you can REPLACE THE DIR NAME zh_CN with new dir named as your language/locale!!!
;;; dirs for Linux
|
Code:
|
mkdir /usr/share/emacs/$VERSION/site-lisp/zh_CN/
mkdir /usr/share/emacs/$VERSION/site-lisp/zh_CN/lisp/language/
mkdir /usr/share/emacs/$VERSION/site-lisp/zh_CN/lisp/international/
mkdir /usr/share/emacs/$VERSION/site-lisp/zh_CN/net/
mkdir /usr/share/emacs/$VERSION/site-lisp/zh_CN/play/ |
;;; FOR PCBSD PBI, THE dir should be like this:
for PCBSD i386
|
Quote:
|
mkdir /usr/pbi/emacs-i386/share/emacs/site-lisp/
mkdir /usr/pbi/emacs-i386/share/emacs/24.0.90/site-lisp/zh_CN/lisp/language/
mkdir /usr/pbi/emacs-i386/share/emacs/24.0.90/site-lisp/zh_CN/lisp/international/
mkdir /usr/pbi/emacs-i386/share/emacs/24.0.90/site-lisp/zh_CN/net/
mkdir /usr/pbi/emacs-i386/share/emacs/24.0.90/site-lisp/zh_CN/play/
|
or for PCBSD amd64
|
Quote:
|
mkdir /usr/pbi/emacs-amd64/share/emacs/site-lisp/
mkdir /usr/pbi/emacs-amd64/share/emacs/24.0.90/site-lisp/zh_CN/lisp/language/
mkdir /usr/pbi/emacs-amd64/share/emacs/24.0.90/site-lisp/zh_CN/lisp/international/
mkdir /usr/pbi/emacs-amd64/share/emacs/24.0.90/site-lisp/zh_CN/net/
mkdir /usr/pbi/emacs-amd64/share/emacs/24.0.90/site-lisp/zh_CN/play/
|
;;; STEP 2: translate files below, and then put them to*
;; /usr/share/emacs/$VERSION/site-lisp/zh_CN/lisp/ follow dirs where them come from:
|
Quote:
|
lisp/menu-bar.el
lisp/facemenu.el
lisp/bookmark.el ;this file translated not works, with unknown reason
lisp/international/mule-cmds.el
lisp/language/chinese.el
lisp/ediff-hook.el
lisp/pcvs-defs.el
lisp/play/animate.el
lisp/net/eudc.el
|
;;; step 3: creat file as root. The file name must be two numbers first, and end as .el*
touch /etc/emacs/site-start.d/90custom-locale.el
;; then edit it and save as below
|
Code:
|
;;--------------------
(load "zh_CN/lisp/menu-bar")
(load "zh_CN/lisp/facemenu")
;(load "zh_CN/lisp/bookmark")
(load "zh_CN/lisp/international/mule-cmds")
(load "zh_CN/lisp/language/chinese")
(load "zh_CN/lisp/ediff-hook")
(load "zh_CN/lisp/pcvs-defs")
(load "zh_CN/lisp/play/animate")
(load "zh_CN/lisp/net/eudc")
;;-------------------- |
TIPS:*
* *you also can write as below for short:
*;;--------------------
(load "menu-bar")
(load "facemenu") *
;...
;;--------------------
also ok. Because Emacs lookup .el files first in site-lisp/*/*.el, if not found, then
lisp/*/*.el (means in 'load' string, site-lisp/ has higher Priority then lisp/
;;; DONE.
;;; Now launch your Emacs. What do you see about it?
======================================
;;; PART 2: for Windows
;;; similar to for Linux/freebsd/pcbsd, but with different dir path:
;;;
;;; STEP 1:*
|
Code:
|
mkdir d:\emacs-$VERSION\site-lisp\zh_CN\
mkdir d:\emacs-$VERSION\site-lisp\zh_CN\lisp\language\
mkdir d:\emacs-$VERSION\site-lisp\zh_CN\lisp\international\
mkdir d:\emacs-$VERSION\site-lisp\zh_CN\net\
mkdir d:\emacs-$VERSION\site-lisp\zh_CN\play\ |
;;; STEP 2: same as for Linux/freebsd/pcbsd
;; translate files below, and then put them to*
;; /usr/share/emacs/$VERSION/site-lisp/zh_CN/lisp/ follow dirs where them come from:
|
Quote:
|
lisp/menu-bar.el
lisp/facemenu.el
lisp/bookmark.el ;this file translated not works, with unknown reason
lisp/international/mule-cmds.el
lisp/language/chinese.el
lisp/ediff-hook.el
lisp/pcvs-defs.el
lisp/play/animate.el
lisp/net/eudc.el
|
;;; step 3: similar to for Linux/freebsd/pcbsd, but with different dir path and fixed file name:
creat file as root. The file name must be "default.el" and must be under site-lisp\
;;; for works
d:\emacs-$VERSION\site-lisp\default.el
;; then edit it and save as below
|
Code:
|
;;--------------------
(load "zh_CN/lisp/menu-bar")
(load "zh_CN/lisp/facemenu")
;(load "zh_CN/lisp/bookmark")
(load "zh_CN/lisp/international/mule-cmds")
(load "zh_CN/lisp/language/chinese")
(load "zh_CN/lisp/ediff-hook")
(load "zh_CN/lisp/pcvs-defs")
(load "zh_CN/lisp/play/animate")
(load "zh_CN/lisp/net/eudc")
;;-------------------- |
;;; NOTE:*
;;*
;; no need to modify Windows registor and modify .reg file;
;; no need to modify .emacs
============================
;;; TIPS:
1* in emacs-locale-zh-cn for Linux, we have another method to attain the goal,
STEP 1 OF SCHEME 1:
use three files, which include in the emacs-locale-zh-cn.deb package:
|
Quote:
|
/usr/share/emacs/site-lisp/english-menu.el ;not need to translate
/usr/share/emacs/site-lisp/chinese-menu.el ;need translated and save as franch-menu.el, german-menu.el ...
/usr/share/emacs/site-lisp/mule-menu.el ;not need to translat
|
STEP 2 OF SCHEME 1:
creat and edit the file, similar as above in STEP 3:
/etc/emacs/site-start.d/90custom-locale.el*
note: line order must be as follow, the "mule-menu" line must be last
|
Code:
|
;------------------------
(require 'english-menu)
(require 'chinese-menu)
(require 'mule-menu)
;------------------------ |
;;; WARNNING: THIS SCHEME NOT FIT FOR WINDOWS! (MAY CAUSE BAD CODINGS!)
ENJOY IT!
file/dir tree