LC_MESSAGES没有效果
LC_MESSAGES has no effect
设置 LC_MESSAGES 将消息(在我的例子中)从俄语更改为英语。
$ env | grep UTF
LC_MESSAGES=en_US.UTF-8
LANG=ru_UA.UTF-8
$ git status .
On branch master
Your branch is ahead of 'origin/master' by 11 commits.
(use "git push" to publish your local commits)
nothing to commit, working directory clean
一切正常,但通过 ssh 连接到该主机。尽管变量 LC_MESSAGES,但仍将消息发回俄罗斯。看:
$ ssh user@localhost
$ env | grep UTF
LC_MESSAGES=en_US.UTF-8
LANG=ru_UA.UTF-8
$ git status .
В ветке master
Your branch is ahead of 'origin/master' by 11 commits.
(use "git push" to publish your local commits)
нечего фиксировать, рабочая директория пуста
如何在俄罗斯保留界面但强制消息为英文?
$ uname -a
Linux KES-PC 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
正如@thatotherguy 指出的那样,我必须使用 locale
来查看发生了什么。
第一种情况:
$locale
LANG=ru_UA.UTF-8
LANGUAGE=
LC_CTYPE="ru_UA.UTF-8"
LC_NUMERIC="ru_UA.UTF-8"
LC_TIME="ru_UA.UTF-8"
LC_COLLATE="ru_UA.UTF-8"
LC_MONETARY="ru_UA.UTF-8"
LC_MESSAGES=en_US.UTF-8
LC_PAPER="ru_UA.UTF-8"
LC_NAME="ru_UA.UTF-8"
LC_ADDRESS="ru_UA.UTF-8"
LC_TELEPHONE="ru_UA.UTF-8"
LC_MEASUREMENT="ru_UA.UTF-8"
LC_IDENTIFICATION="ru_UA.UTF-8"
LC_ALL=
ssh 之后
$ssh user@localhost
$locale
LANG=ru_UA.UTF-8
LANGUAGE=ru_UA:ru
LC_CTYPE="ru_UA.UTF-8"
LC_NUMERIC="ru_UA.UTF-8"
LC_TIME="ru_UA.UTF-8"
LC_COLLATE="ru_UA.UTF-8"
LC_MONETARY="ru_UA.UTF-8"
LC_MESSAGES=en_US.UTF-8
LC_PAPER="ru_UA.UTF-8"
LC_NAME="ru_UA.UTF-8"
LC_ADDRESS="ru_UA.UTF-8"
LC_TELEPHONE="ru_UA.UTF-8"
LC_MEASUREMENT="ru_UA.UTF-8"
LC_IDENTIFICATION="ru_UA.UTF-8"
LC_ALL=
区别是LANGUAGE
。谷歌搜索帮助。该变量设置在 /etc/defaults/locale
$ cat /etc/default/locale
LANG="ru_UA.UTF-8"
LANGUAGE="ru_UA:ru"
所以我添加到我的 .bashrc
export LANGUAGE=en
但是现在不明白:
- 我有
LANGUAGE
设置在/etc/defautls/locale。为什么在第一种情况下它的值为空字符串?
- 为什么
LANGUAGE
优先级不起作用?如果我设置 LANGUAGE=en:ru
或 LANGUAGE=ru:en
我在这两种情况下都会收到俄语消息。
设置 LC_MESSAGES 将消息(在我的例子中)从俄语更改为英语。
$ env | grep UTF
LC_MESSAGES=en_US.UTF-8
LANG=ru_UA.UTF-8
$ git status .
On branch master
Your branch is ahead of 'origin/master' by 11 commits.
(use "git push" to publish your local commits)
nothing to commit, working directory clean
一切正常,但通过 ssh 连接到该主机。尽管变量 LC_MESSAGES,但仍将消息发回俄罗斯。看:
$ ssh user@localhost
$ env | grep UTF
LC_MESSAGES=en_US.UTF-8
LANG=ru_UA.UTF-8
$ git status .
В ветке master
Your branch is ahead of 'origin/master' by 11 commits.
(use "git push" to publish your local commits)
нечего фиксировать, рабочая директория пуста
如何在俄罗斯保留界面但强制消息为英文?
$ uname -a Linux KES-PC 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
正如@thatotherguy 指出的那样,我必须使用 locale
来查看发生了什么。
第一种情况:
$locale
LANG=ru_UA.UTF-8
LANGUAGE=
LC_CTYPE="ru_UA.UTF-8"
LC_NUMERIC="ru_UA.UTF-8"
LC_TIME="ru_UA.UTF-8"
LC_COLLATE="ru_UA.UTF-8"
LC_MONETARY="ru_UA.UTF-8"
LC_MESSAGES=en_US.UTF-8
LC_PAPER="ru_UA.UTF-8"
LC_NAME="ru_UA.UTF-8"
LC_ADDRESS="ru_UA.UTF-8"
LC_TELEPHONE="ru_UA.UTF-8"
LC_MEASUREMENT="ru_UA.UTF-8"
LC_IDENTIFICATION="ru_UA.UTF-8"
LC_ALL=
ssh 之后
$ssh user@localhost
$locale
LANG=ru_UA.UTF-8
LANGUAGE=ru_UA:ru
LC_CTYPE="ru_UA.UTF-8"
LC_NUMERIC="ru_UA.UTF-8"
LC_TIME="ru_UA.UTF-8"
LC_COLLATE="ru_UA.UTF-8"
LC_MONETARY="ru_UA.UTF-8"
LC_MESSAGES=en_US.UTF-8
LC_PAPER="ru_UA.UTF-8"
LC_NAME="ru_UA.UTF-8"
LC_ADDRESS="ru_UA.UTF-8"
LC_TELEPHONE="ru_UA.UTF-8"
LC_MEASUREMENT="ru_UA.UTF-8"
LC_IDENTIFICATION="ru_UA.UTF-8"
LC_ALL=
区别是LANGUAGE
。谷歌搜索帮助。该变量设置在 /etc/defaults/locale
$ cat /etc/default/locale
LANG="ru_UA.UTF-8"
LANGUAGE="ru_UA:ru"
所以我添加到我的 .bashrc
export LANGUAGE=en
但是现在不明白:
- 我有
LANGUAGE
设置在/etc/defautls/locale。为什么在第一种情况下它的值为空字符串? - 为什么
LANGUAGE
优先级不起作用?如果我设置LANGUAGE=en:ru
或LANGUAGE=ru:en
我在这两种情况下都会收到俄语消息。