如何永久设置语言环境中的语言

如何永久设置语言环境中的语言

遇到此错误后:https://gitlab.gnome.org/GNOME/gnome-control-center/issues/236

我无法修复我的语言环境。无法使用 gnome-control-center 修复它,并且“export LANGUAGE=gd:en_GB:en”只能在当前终端中修复它。

我读过了https://help.ubuntu.com/community/EnvironmentVariables#Persistent_environment_variables

还,

$ cat /etc/default/locale
LANGUAGE="gd:de_DE:en_GB:en"
LC_NUMERIC="gd_GB.UTF-8"
LC_TIME="gd_GB.UTF-8"
LC_MONETARY="gd_GB.UTF-8"
LC_PAPER="gd_GB.UTF-8"
LC_IDENTIFICATION="gd_GB.UTF-8"
LC_NAME="gd_GB.UTF-8"
LC_ADDRESS="gd_GB.UTF-8"
LC_TELEPHONE="gd_GB.UTF-8"
LC_MEASUREMENT="gd_GB.UTF-8"
LANG="gd_GB.UTF-8"

但当我再次登录并启动终端时,de_DE 又回来了。

我已按照建议编辑了 /etc/common/locale,此文件现在已清理干净,但语言环境设置已退化。重新设置语言环境没有效果,因为语言环境本身没有损坏。程序仍在使用德语,并且已在终端中列出。应用更改后重新启动没有效果。

$ cat /etc/default/locale
LANGUAGE=gd:en_GB:en
LC_NUMERIC="gd_GB.UTF-8"
LC_TIME="gd_GB.UTF-8"
LC_MONETARY="gd_GB.UTF-8"
LC_PAPER="gd_GB.UTF-8"
LC_IDENTIFICATION="gd_GB.UTF-8"
LC_NAME="gd_GB.UTF-8"
LC_ADDRESS="gd_GB.UTF-8"
LC_TELEPHONE="gd_GB.UTF-8"
LC_MEASUREMENT="gd_GB.UTF-8"
LANG="gd_GB.UTF-8"

$ locale
LANG=gd_GB.UTF-8
LANGUAGE=gd:de_DE:en_GB:en
<snip>

$ sudo locale-gen "en_US.UTF-8"
Generating locales (this might take a while)...
  en_US.UTF-8... done
Generation complete.

$ sudo dpkg-reconfigure locales
Generating locales (this might take a while)...
  en_AG.UTF-8... done
<snip>
  en_ZW.UTF-8... done
  gd_GB.UTF-8... done
Generation complete.

$ locale
LANG=gd_GB.UTF-8
LANGUAGE=gd:de_DE:en_GB:en
LC_CTYPE="gd_GB.UTF-8"
LC_NUMERIC=gd_GB.UTF-8
LC_TIME=gd_GB.UTF-8
LC_COLLATE="gd_GB.UTF-8"
LC_MONETARY=gd_GB.UTF-8
LC_MESSAGES="gd_GB.UTF-8"
LC_PAPER=gd_GB.UTF-8
LC_NAME=gd_GB.UTF-8
LC_ADDRESS=gd_GB.UTF-8
LC_TELEPHONE=gd_GB.UTF-8
LC_MEASUREMENT=gd_GB.UTF-8
LC_IDENTIFICATION=gd_GB.UTF-8
LC_ALL=

答案1

您可以/etc/default/locale像这样手动更新:

sudo update-locale LANGUAGE=gd:en_GB:en

答案2

grep解决方法——需要编辑以下两个文件来sudo gedit删除语言环境:

/etc/default/locale
/home/<user>/.pam_environment

答案3

您尝试重新配置了吗?如果没有,那么试试这个 -

sudo locale-gen “en_US.UTF-8”
sudo dpkg-reconfigure locales

相关内容