我要在默认语言是英语的情况下输入中文怎么办?

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
bigbird
帖子: 113
注册时间: 2006-07-07 18:11

我要在默认语言是英语的情况下输入中文怎么办?

#1

帖子 bigbird » 2007-10-23 22:32

我要在默认语言是英语的情况下输入中文怎么办?

我已经安装了中文语言包并且可以设置成中文,这时候scim好用,客以输入中文。
头像
Element
帖子: 3537
注册时间: 2005-09-10 16:04
来自: DG-GD-China

#2

帖子 Element » 2007-10-23 22:35

在把默认语言设置为英语就可以了
http://element.blog.ubuntu.org.cn/
Ubuntu Jaunty Jackalope...
AMD Barton 2600+
MSI K7N2 Delta-L
Kingston DDR400 512M*2+256M*1
nVidia FX5200
Seagate 80G(Jaunty Jackalope)
Seagate 160G(XXxxXX)
SyncMaster 732N
头像
Element
帖子: 3537
注册时间: 2005-09-10 16:04
来自: DG-GD-China

#3

帖子 Element » 2007-10-23 22:38

设置你的 locale 就可以了
~$ locale
LANG=en_US.UTF-8
LANGUAGE=en_US:en_GB:en
LC_CTYPE=zh_CN.UTF-8
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
http://element.blog.ubuntu.org.cn/
Ubuntu Jaunty Jackalope...
AMD Barton 2600+
MSI K7N2 Delta-L
Kingston DDR400 512M*2+256M*1
nVidia FX5200
Seagate 80G(Jaunty Jackalope)
Seagate 160G(XXxxXX)
SyncMaster 732N
maskisland
帖子: 26
注册时间: 2007-08-25 7:42

#4

帖子 maskisland » 2007-10-24 19:27

把这个代码 复制到一个文件里 比如install_chinese_support
然后在终端里打chmod 755 install_chinese_support
然后打 sudo ./install_chinese_support

如果装完之后默认输入法 不是 chinese 的话,在scim 图标点右键选设置,自己设置一下好了。

#! /usr/bin/env python
# -*- coding: utf-8 -*-
#License: PGL


import os,commands,sys,os.path

__debug=True

def is_superuser():
return commands.getoutput('whoami')=='root'

def pop_error(msg):
raise Exception(msg)

def execute_command(command):
if __debug:
print "executing command: "+command
if os.system(command):
pop_error("Failed to execute command: "+command)


def install_scim():
# install scim package
install_scim_cmd="apt-get install scim scim-chinese scim-config-socket scim-frontend-socket scim-gtk2-immodule scim-server-socket scim-tables-zh xfonts-intl-chinese xfonts-intl-chinese-big ttf-arphic-gbsn00lp ttf-arphic-gkai00mp ttf-arphic-bkai00mp ttf-arphic-bsmi00lp"
execute_command(install_scim_cmd)
# install scim configures
create_xsession_cmd=r"scim -d\nexport XMODIFIERS=@im=scim\nexport GTK_IM_MODULE=scim\ngnome-session"
execute_command("echo \""+create_xsession_cmd+"\" > ~/.xsession")
execute_command("chmod +x ~/.xsession")


def install_locale_support():
install_lanuage_package_cmd="apt-get install language-pack-zh"
locale_gens="locale-gen zh_CN.GBK && locale-gen zh_CN"
execute_command(install_lanuage_package_cmd)
execute_command(locale_gens)


if is_superuser():
install_locale_support()
install_scim()
else:
print "this command requires superuser privilege"
bigbird
帖子: 113
注册时间: 2006-07-07 18:11

#5

帖子 bigbird » 2007-10-24 21:27

Element 写了:在把默认语言设置为英语就可以了
你好,我设置了英语,可是scim都不会自动启动了,输入法也没反应,只能输入英文。
bigbird
帖子: 113
注册时间: 2006-07-07 18:11

#6

帖子 bigbird » 2007-10-24 21:37

maskisland 写了:把这个代码 复制到一个文件里 比如install_chinese_support
然后在终端里打chmod 755 install_chinese_support
然后打 sudo ./install_chinese_support

如果装完之后默认输入法 不是 chinese 的话,在scim 图标点右键选设置,自己设置一下好了。

#! /usr/bin/env python
# -*- coding: utf-8 -*-
#License: PGL


import os,commands,sys,os.path

__debug=True

def is_superuser():
return commands.getoutput('whoami')=='root'

def pop_error(msg):
raise Exception(msg)

def execute_command(command):
if __debug:
print "executing command: "+command
if os.system(command):
pop_error("Failed to execute command: "+command)


def install_scim():
# install scim package
install_scim_cmd="apt-get install scim scim-chinese scim-config-socket scim-frontend-socket scim-gtk2-immodule scim-server-socket scim-tables-zh xfonts-intl-chinese xfonts-intl-chinese-big ttf-arphic-gbsn00lp ttf-arphic-gkai00mp ttf-arphic-bkai00mp ttf-arphic-bsmi00lp"
execute_command(install_scim_cmd)
# install scim configures
create_xsession_cmd=r"scim -d\nexport XMODIFIERS=@im=scim\nexport GTK_IM_MODULE=scim\ngnome-session"
execute_command("echo ""+create_xsession_cmd+"" > ~/.xsession")
execute_command("chmod +x ~/.xsession")


def install_locale_support():
install_lanuage_package_cmd="apt-get install language-pack-zh"
locale_gens="locale-gen zh_CN.GBK && locale-gen zh_CN"
execute_command(install_lanuage_package_cmd)
execute_command(locale_gens)


if is_superuser():
install_locale_support()
install_scim()
else:
print "this command requires superuser privilege"

请问复制到一个文件里,这个文件必须放在哪里?这一步就卡住了。
bigbird
帖子: 113
注册时间: 2006-07-07 18:11

#7

帖子 bigbird » 2007-10-24 21:39

Element 写了:设置你的 locale 就可以了
~$ locale
LANG=en_US.UTF-8
LANGUAGE=en_US:en_GB:en
LC_CTYPE=zh_CN.UTF-8
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

菜鸟再问?这个在终端里面操作?
头像
猛将兄
帖子: 2052
注册时间: 2005-10-19 17:33

#8

帖子 猛将兄 » 2007-10-24 22:10

你们搞的太复杂了
你在语言支持里面设置成英文
然后在新利得里面
装im-swith,fcitx
装好之后
im-switch -s en_US fcitx
最tricky的一段,是

sudo gedit /usr/lib/gtk-2.0/2.10.0/immodule-files.d/libgtk2.0-0.immodules
把最后一行改成
"xim" "X Input Method" "gtk20" "/usr/share/locale" "en:ko:ja:th:zh"

不过这样有个问题,你要是用wine模拟某些中文程序的时候,会有乱码

这个问题主要是因为中文的windows程序很多都是用中文字符+仿宋+GBK写死了
我也没有太好的办法,只好在
sudo gedit /etc/environment
里面,加上一句
LC_ALL="zh_CN.UTF-8"
这样,你的菜单什么的,都编程中文字了,但是命令行里面,以及你的默认环境,却的确是英文的。可以
ctrl+alt+F1切换到控制台,随便打个什么命令,可以看到,提示,或者错误信息都是英文的了
头像
Element
帖子: 3537
注册时间: 2005-09-10 16:04
来自: DG-GD-China

#9

帖子 Element » 2007-10-24 23:19

源自wiki:

如果您要在非CJK(中日韩)的locales下使用scim,请在终端执行如下命令(如果默认是中文环境不需要这一步,系统已经设置好了):

代码: 全选

sudo apt-get install scim scim-modules-socket scim-modules-table scim-pinyin scim-tables-zh scim-gtk2-immodule im-switch libapt-pkg-perl 

代码: 全选

sudo gedit /etc/X11/xinit/xinput.d/default
加入

代码: 全选

XIM=SCIM
XIM_PROGRAM=/usr/bin/scim
XIM_ARGS="-d"
GTK_IM_MODULE=scim
QT_IM_MODULE=scim
DEPENDS="scim,scim-gtk2-immodule | scim-qtimm" 
重启Gnome以后生效。

提示:带table的包为输入法码表,安装之后才有除拼音以外的输入法,如五笔、二笔、自然码等,如果你只使用拼音输入法就不用装这些包了。

代码: 全选

sudo im-switch -s scim -z default
http://element.blog.ubuntu.org.cn/
Ubuntu Jaunty Jackalope...
AMD Barton 2600+
MSI K7N2 Delta-L
Kingston DDR400 512M*2+256M*1
nVidia FX5200
Seagate 80G(Jaunty Jackalope)
Seagate 160G(XXxxXX)
SyncMaster 732N
头像
goldfox_79
帖子: 2004
注册时间: 2005-10-16 8:26
来自: 地球

#10

帖子 goldfox_79 » 2007-10-24 23:59

英文local下使用fcitx我知道

sudo apt-get install fcitx im-switch

im-switch -s fcitx

sudo gedit /usr/lib/gtk-2.0/2.10.0/immodule-files.d/libgtk2.0-0.immodules
把"xim" "X Input Method" "gtk20" "/usr/share/locale" "ko:ja:th:zh" 改成 "xim" "X Input Method" "gtk20" "/usr/share/locale" "en:ko:ja:th:zh"

如果使用fcitx时发现fcitx显示的是框框,则修改.fcitx/config文件,把中文字体设置为本机安装的某个中文字体
bigbird
帖子: 113
注册时间: 2006-07-07 18:11

#11

帖子 bigbird » 2007-10-25 8:35

谢谢各位的回答,我认为这个很实用

既能温习逐渐忘却的英文,又能在需要中文输入的时候可以用中文交流.

还是请大侠们给出个定式吧.

这几天使用Ubuntu 的感觉是功能很强大,但入门的人往往找不到解决的办法.论坛和Wiki也去过了

我现在最需要的功能是网上银行和股票交易功能,这些都怪可恨的银行和软件开发商,惟利是图是他们生存的目的.
回复