如何在Linux中设置语言环境?

The locale is the configuration of a Linux system that provides a region, keyboard, time-related data. The locale is important because it will change the interpretation of some keyboards etc. If you are getting the following warning like “Setting locale failed” we will look at how to solve it.

语言环境是Linux系统的配置,提供了区域,键盘和与时间相关的数据。 语言环境很重要,因为它会更改某些键盘等的解释。如果收到“设置语言环境失败”之类的警告,我们将研究如何解决。

列出当前区域设置 (List Current Locale Setting)

Listing of current locale settings can be done just by issuing locale commands. We do not need to provide an option for listing.

仅通过发出区域设置命令即可列出当前区域设置。 我们不需要提供上市选项。

$ locale
List Current Locale Setting
List Current Locale Setting
列出当前区域设置

As we can see that there are different locale settings like TIME, ADDRESS , MEASUREMENT, MONETARY etc.

如我们所见,有不同的语言环境设置,例如TIMEADDRESSMEASUREMENTMONETARY等。

更改局部变量 (Change Local Variable)

We see that LC_ALL environment variable is not set and the problem is that some application needs this locale to be set. We will use update-locale command in order to change the current locale. We will also provide the locale we want to set which is en_US.UTF-8 in this example.

我们看到未设置LC_ALL环境变量,问题是某些应用程序需要设置此语言环境。 我们将使用update-locale命令来更改当前语言环境。 在此示例中,我们还将提供要设置的语言环境,即en_US.UTF-8

$ sudo update-locale LC_ALL="en_US.UTF-8"
  • update-locale is a command which will update locale configuration

    update-locale是将更新语言环境配置的命令

  • LC_ALL="en_US.UTF-8" is the locale variable we want to update

    LC_ALL="en_US.UTF-8"是我们要更新的语言环境变量

$ locale

To effect the settings log out and log in for locale command.

要使设置生效,请注销并登录locale命令。

Change Local Variable
Change Local Variable
更改局部变量
LEARN MORE  How To Download and Install Kali Security and Penetration Test Linux Distribution?
了解更多信息如何下载和安装Kali Security and Penetration Test Linux发行版?

翻译自: https://www.poftut.com/set-locale-linux/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值