LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 642|回复: 5

请问如何控制gtk程序的界面语言(中英)?

[复制链接]
发表于 2004-8-30 06:18:37 | 显示全部楼层 |阅读模式
MANDRAKE10.0中文版,init3登陆后,用startx启动X,gtk程序(如xmms,gaim,gimp,gnomemeeting)的界面均为英文;而用kdm,gdm启动或者改为直接init5登陆的话,gtk程序正常为中文;

我的locale:
$ locale
LANG=zh_CN
LC_CTYPE="zh_CN"
LC_NUMERIC="zh_CN"
LC_TIME="zh_CN"
LC_COLLATE="zh_CN"
LC_MONETARY="zh_CN"
LC_MESSAGES="zh_CN"
LC_PAPER="zh_CN"
LC_NAME="zh_CN"
LC_ADDRESS="zh_CN"
LC_TELEPHONE="zh_CN"
LC_MEASUREMENT="zh_CN"
LC_IDENTIFICATION="zh_CN"
LC_ALL=zh_CN

而且我用crossover3.0
init 5进入的话,用crossover的IE6,默认的主页是http://www.microsoft.com/china/ 中文页面
init 3进入的是http://www.msn.com/ 英文页面,而且所有中文程序界面为乱码

主要是gtk的问题能解决就好,具体的是因为文件配置的问题吗?
发表于 2004-8-30 12:08:39 | 显示全部楼层
/etc/sysconfig/i18n的设置是什么?
~/.bashrc是否设置了locale
 楼主| 发表于 2004-8-30 23:04:38 | 显示全部楼层
最初由 aaccdd 发表
/etc/sysconfig/i18n的设置是什么?
~/.bashrc是否设置了locale


/etc/sysconfig/i18n
LANGUAGE=zh_CN.GB2312:zh_CN:zh
GTK_IM_MODULE=xim
LC_ADDRESS=zh_CN
LC_COLLATE=zh_CN
XIM=Chinput
LC_NAME=zh_CN
LC_NUMERIC=zh_CN
LC_MEASUREMENT=zh_CN
LC_TIME=zh_CN
LANG=zh_CN
LC_IDENTIFICATION=zh_CN
LC_MESSAGES=zh_CN
LC_CTYPE=zh_CN
LC_TELEPHONE=zh_CN
CONSOLE_NOT_LOCALIZED=yes
ENC=gb
LC_MONETARY=zh_CN
XIM_PROGRAM="chinput -gb"
LC_PAPER=zh_CN
XMODIFIERS="@im=Chinput"
/etc/sysconfig/i18n lines 1-20/20 (END)

~/.bashrc  原来这里默认是没有设置的,有这个问题后加了LC_ALL=zh_CN,但是没有效果
# .bashrc

# User specific aliases and functions

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi
export LC_ALL=zh_CN

/etc/bashrc
# /etc/bashrc

# System wide functions and aliases
# Environment stuff goes in /etc/profile

# by default, we want this to get set.
# Even for non-interactive, non-login shells.
if [ "`id -gn`" = "`id -un`" -a `id -u` -gt 99 ]; then
        umask 002
else
        umask 022
fi

# are we an interactive shell?
if [ "$PS1" ]; then
    case $TERM in
        xterm*)
            PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
            ;;
        *)
            ;;
    esac
    [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "

    if [ -z "$loginsh" ]; then # We're not a login shell
        for i in /etc/profile.d/*.sh; do
            if [ -x $i ]; then
                . $i
            fi
        done
    fi
fi

unset loginsh

这些有问题吗?
 楼主| 发表于 2004-9-1 08:18:12 | 显示全部楼层

感谢aaccdd

在/etc/sysconfig/i18添加LANG=zh_CN.GB2312后
init 3,crossover下中文问题解决,ie打开的默认首页成了http://china.msn.com/
但是GTK问题依旧
 楼主| 发表于 2004-9-1 08:52:18 | 显示全部楼层

以下就是/etc/X11/Xresources的内容,自己在最后加了96,其他没有动过

! Parts (C) 1996 By Greg J. Badros <gjb@cs.duke.edu>
! Modification for Mandrake Linux by Chmouel Boudjnah <chmouel@mandraksoft.com>
! You may use this file as specified under the GNU General Public License

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! emacs, xemacs

emacs*Background: DarkSlateGray
emacs*Foreground: Wheat
emacs*pointerColor: Orchid
emacs*cursorColor: Orchid
emacs*bitmapIcon: on
emacs*font: fixed
emacs.geometry: 80x25

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! xterm (and friends)

XTerm*highlightSelection:  true
! Uncomment this to use color for the bold attribute
XTerm*VT100*colorBDMode:  on
XTerm*VT100*colorBD:  blue
! Uncomment this to use color for underline attribute
XTerm.VT100*colorULMode:  on
XTerm.VT100*underLine:  off
XTerm*VT100*colorUL:  magenta
! Uncomment this to display the scrollbar
XTerm*scrollBar:  true

! This resource specifies whether or not to ignore the 'alternate screen'
! of applications such as vi.  When it is on, these applications will restore
! the contents of the screen when they are exited to what they were before
! they were started.  When it is off, the contents of vi will remain on the
! screen after the program is quit.
XTerm.VT100.titeInhibit:  true

! Uncomment this to turn off color mode in your xterms
!XTerm.VT100*colorMode:  off
XTerm.VT100*dynamicColors:  on

! Number of lines of scrollback to save
XTerm*saveLines:        1500

xterm*reverseWrap:        true

*visualBell:                true
*scrollTtyOutput:        False
*scrollKey:                True
Scrollbar.JumpCursor:        True

! Suppr support.
*VT100.Translations: #override \
<Key>BackSpace: string(0x7F)\n\
<Key>Delete: string("\033[3~")\n\
<Key>Home: string("\033[1~")\n\
<Key>End: string("\033[4~")

! GVim great Colors.
Vim*background:        black
Vim*foreground:        lightyellow
Vim*font:                -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-15-*5
Vim*geometry:        88x35
Vim*menuBackground: black
Vim*menuForeground: moccasin

! Fix the Xft dpi to 96; this prevents tiny fonts
! or HUGE fonts depending on the screen size.
!Xft.dpi: 96
 楼主| 发表于 2004-11-5 22:37:07 | 显示全部楼层
在orphen的提示下终于解决了这个问题,init3下用startx登陆后GTK程序界面为英文的原因是:
i18n里的LANGUAGE=zh_CN.GB2312:zh_CN:zh 这一项没有export,解决的办法就是,在用户目录下的.bashrc 文件中加入[PHP]LANGUAGE=zh_CN.GB2312:zh_CN:zh[/PHP]
至此init3登陆后GTK界面变英文的问题终于解决!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表