- lang=`locale | grep 'LANGUAGE'|cut -d= -f2`
- if [ "$lang" == "en_US.utf-8" ];then
- lang='zh_CN.utf-8'
- elif [ $lang == 'zh_CN.utf-8' ];then
- lang='en_US.utf-8'
- else
- echo -e "System Language is not Chinese or English\\n"
- fi
- LANGUAGE="$lang"
- export LANGUAGE
- #该片段来自于http://www.codesnippet.cn/detail/090520133241.html
来源: http://www.codesnippet.cn/detail/090520133241.html