LC_MESSAGES无效

时间:2015-03-26 20:10:30

标签: linux localization mint

设置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

Everythings似乎没问题,但是通过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

1 个答案:

答案 0 :(得分:0)

正如@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

但现在我不明白:

  1. 我在/ etc / defautls / locale设置LANGUAGE。为什么在第一种情况下它的值为空字符串?
  2. 为什么LANGUAGE优先级不起作用?如果我设置LANGUAGE=en:ruLANGUAGE=ru:en,我在这两种情况下都会收到俄语消息。