linux图形界面为英文,Linux下“英文控制台 中文图形界面”的实现
以Slackware12.2為例:
首先安裝好slackware12.2,裝好后敲入startx,進入圖形界面。第一次登錄圖形界面時會提示你是哪國人(查下戶口先^_^),堅定的選擇中國,默認語言就是簡體中文,確定后就進入了全中文圖形界面。然而進去后就看到很不舒服的中文,看到的中文界面詞組基本都是缺胳膊少腿的,必須要從頭設(shè)置了。
打開終端(鼠標右鍵點運行,輸入konsole,就出來了),輸入locale來看看語言設(shè)置,我的結(jié)果如下:
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_TIME="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=en_US.UTF-8
意義如下:
1、語言符號及其分類(LC_CTYPE)
2、數(shù)字(LC_NUMERIC)
3、比較和排序習(xí)慣(LC_COLLATE)
4、時間顯示格式(LC_TIME)
5、貨幣單位(LC_MONETARY)
6、信息主要是提示信息,錯誤信息,狀態(tài)信息,標題,標簽,按鈕和菜單等(LC_MESSAGES)
7、姓名書寫方式(LC_NAME)
8、地址書寫方式(LC_ADDRESS)
9、電話號碼書寫方式(LC_TELEPHONE)
10、度量衡表達方式 (LC_MEASUREMENT)
11、默認紙張尺寸大小(LC_PAPER)
12、對locale自身包含信息的概述(LC_IDENTIFICATION)
下邊的設(shè)置都是對/etc/profile.d/lang.sh的改動,改動前將文件中都注釋掉(加#,可別習(xí)慣加//^_^):
一).如果你需要一個純中文的GUI的話,寫入LC_ALL=zh_CN.UTF-8,或者LANG=zh_CN.UTF-8都可以。那12個LC_**不寫。
二).如果你也和我一樣想要英文CLI,中文GUI,那么就寫入LC_CTYPE=zh_CN.UTF-8,LANG=en_US.UTF-8就可以了。其他的不寫。
三).假如你高興的話,可以把12個LC_**一一設(shè)定成你需要的值,打造一個古靈精怪的系統(tǒng): LC_CTYPE=zh_CN.GBK/GBK(使用中文編碼內(nèi)碼GBK字符集); LC_NUMERIC=en_GB.ISO-8859-1(使用大不列顛的數(shù)字系統(tǒng)) LC_MEASUREMENT=de_DE@euro.ISO-8859-15(德國的度量衡使用ISO-8859-15字符集) 羅馬的地址書寫方式,美國的紙張設(shè)定……。估計沒人這么干吧- -!
下邊是我改動前的lang.sh:
#!/bin/sh # Set the system locale. (no, we don't have a menu for this ;-) # For a list of locales which are supported by this machine, type: # locale -a # en_US is the Slackware default locale: export LANG=en_US # 'C' is the old Slackware (and UNIX) default, which is 127-bit # ASCII with a charmap setting of ANSI_X3.4-1968. These days, # it's better to use en_US or another modern $LANG setting to # support extended character sets. #export LANG=C # There is also support for UTF-8 locales, but be aware that # some programs are not yet able to handle UTF-8 and will fail to # run properly. In those cases, you can set LANG=C before # starting them. Still, I'd avoid UTF unless you actually need it. #export LANG=en_US.UTF-8 # Another option for en_US: #export LANG=en_US.ISO8859-1 # One side effect of the newer locales is that the sort order # is no longer according to ASCII values, so the sort order will # change in many places. Since this isn't usually expected and # can break scripts, we'll stick with traditional ASCII sorting. # If you'd prefer the sort algorithm that goes with your $LANG # setting, comment this out. export LC_COLLATE=C # End of /etc/profile.d/lang.sh
這個是我設(shè)置后的lang.sh:
#!/bin/sh # Set the system locale. (no, we don't have a menu for this ;-) # For a list of locales which are supported by this machine, type: # locale -a # en_US is the Slackware default locale: # export LANG=en_US export LC_CTYPE=zh_CN.UTF-8 export LANG=en_US.UTF-8 # 'C' is the old Slackware (and UNIX) default, which is 127-bit # ASCII with a charmap setting of ANSI_X3.4-1968. These days, # it's better to use en_US or another modern $LANG setting to # support extended character sets. #export LANG=C # There is also support for UTF-8 locales, but be aware that # some programs are not yet able to handle UTF-8 and will fail to # run properly. In those cases, you can set LANG=C before # starting them. Still, I'd avoid UTF unless you actually need it. #export LANG=en_US.UTF-8 # Another option for en_US: #export LANG=en_US.ISO8859-1 # One side effect of the newer locales is that the sort order # is no longer according to ASCII values, so the sort order will # change in many places. Since this isn't usually expected and # can break scripts, we'll stick with traditional ASCII sorting. # If you'd prefer the sort algorithm that goes with your $LANG # setting, comment this out. # export LC_COLLATE=C # End of /etc/profile.d/lang.sh
如果想知道更多的LC_**知識,請去 http://hi.baidu.com/edeed/blog/item/2e99a14440bd8884b2b7dcb1.html看看。
至于其他的linux發(fā)行版,我想原理應(yīng)該差不多,大家研究研究吧。與君共勉!!
總結(jié)
以上是生活随笔為你收集整理的linux图形界面为英文,Linux下“英文控制台 中文图形界面”的实现的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mysql 分表后排序_MySQL优化分
- 下一篇: c++thread里暂停线程_Java线