Ubuntu installs Chinese zh_CN.UTF-8

How to install Chinese support for Ubuntu system Install zh_CN.UTF-8

How toInstalling Chinese support in the system includes two steps: installing the Chinese package and configuring environment variables.

Installing Chinese support in Ubuntu is very simple and can be done in two steps:

The first step is to install the Chinese language pack:

sudo apt-get install language-pack-zh*

The second step is to configure relevant environment variables:

sudo vim /etc/environment

Add the following settings to the file:

LANG="zh_CN.UTF-8" LANGUAGE="zh_CN:zh:en_US:en" LC_ALL="LC_ALL=zh_CN.UTF-8"

The third step is to reset the local configuration:

sudo dpkg-reconfigure locales

Install Chinese zh_CN.UTF-8-1 on Ubuntu system

Install Chinese zh_CN.UTF-8-1 on Ubuntu system

If you do not need Chinese input method, the following steps can be omitted.

In addition, in order to ensure the normal use of the Chinese input method, you also need to install a Chinese input method engine, such as ibus-pinyin:

sudo apt-get install ibus-pinyin

After the installation is complete, you can enable ibus-pinyin with the following command:

apt install ibus ibus-daemon -drx

Finally, select ibus-pinyin as the input method in the system settings.

Related commands:

locale --all-locales List all supported locales in the current system

localectl list-locales List all available locales in the current system

localectl set-locales LOCALE... Modifies the locale in the current system. It has the same function as locale and the same as the three variables mentioned above in export.

At this point, you have successfully installed Chinese support in the Ubuntu system and can use the Chinese input method and display the Chinese interface normally.

The terminal displays Chinese normally, but the application displays Chinese abnormally.

The question addressed in this paper is “""”, “”, “", "cannot change locale ()","”, “”, “", etc., providing a one-stop solution. If the system displays Chinese abnormally, such as garbled Chinese characters, you can refer to this article

In order to display Chinese characters normally in the application, the following three variables should be as follows:

LANG=zh_CN.UTF-8 LANGUAGE=zh_CN:zh:en_US:en LC_ALL=LC_ALL=zh_CN.UTF-8

But the problem is "LC_ALL to default locale: No such file or directory" and "LC_ALL: cannot change locale (zh_CN.UTF-8) ", so reinstall Chinese language pack.

Execute the following command

sudo apt-get -y install language-pack-zh-hans

or

sudo apt-get -y install language-pack-zh-hans language-pack-zh-hans-base

If you want to support traditional Chinese characters, execute

sudo apt-get -y install language-pack-zh-hant

or

sudo apt-get -y install language-pack-zh-hant language-pack-zh-hant-base

Then execute the locale command to set the current locale environment

locale

5/5 - (1 vote)

Leave a Reply

Your email address will not be published. Required fields are marked *