Configuring Locales under Debian/Ubuntu

6 views
Skip to first unread message

Jerry

unread,
Feb 14, 2007, 9:48:57 AM2/14/07
to 草稿本
The Easy Way ;Install debconf (i.e. run apt-get update then apt-get install debconf, as root) ;Run dpkg-reconfigure locales as root

The Hard Way ;Edit /etc/locale.gen as root. If /etc/locale.gen does not exist, create it. An example /etc/locale.gen is below. ;Run /usr/sbin/locale-gen as root

A sample /etc/locale.gen

   1. This file lists locales that you wish to have built. You can find a list
   2. of valid supported locales at /usr/share/i18n/SUPPORTED. Other
   3. combinations are possible, but may not be well tested. If you change
   4. this file, you need to rerun locale-gen.
   5.
   6. XXX GENERATED XXX
   7.
   8. NOTE!!! If you change this file by hand, and want to continue
   9. maintaining manually, remove the above line. Otherwise, use the command
  10. "dpkg-reconfigure locales" to manipulate this file. You can manually
  11. change this file without affecting the use of debconf, however, since it
  12. does read in your changes.

en_US.UTF-8 UTF-8

翻译如下:

配置Locales

简单的办法:安装debconf(以root身份运行apt-get update然后运行apt-get install debconf);再以root身份运行dpkg-reconfigure locales

复杂的办法:以root身份编辑 /etc/locale.gen。如果/etc/locale.gen不存在,则创建它。下面给出了一个 /etc/locale.gen的例子。以root身份运行 /usr/sbin/locale-gen。

一个/etc/locale.gen的例子

 1. 该文件所列出的locales中含有你想要建立的某个locale。你可以找到一个系统
 2. 所支持的合法locale的列表,在文件/usr/share/i18n/SUPPPORTED。其它
 3. 组合形式也是可能的,但是没有被很好地测试。如果你改变
 4. 了该文件,那你需要运行一下locale-gen。
 5.
 6. XXX 创建 XXX
 7.
 8. 注意!!!如果你手动改变了该文件,并且想继续
 9. 手工地维护之, 则要拿掉上面一行。否则, 使用命令
 10. "dpkg-reconfigure locales" 创建该文件。 你可手工地
 11. 修改该文件(/etc/locale.gen)而不会影响到debconf的使用,但是,因为塔
 12. 会读到你的改变。

en_US.UTF-8 UTF-8


--
Jerry

Jerry

unread,
Feb 23, 2007, 7:05:13 AM2/23/07
to jerry66x
unset LANG

上述命令可以把系统提示由中文改成英文

Reply all
Reply to author
Forward
0 new messages