$ lang linux system language

Linux LANG variable is set: the main language environment definition system

LANG variable defines the Linux primary language environment system, the default value of this variable as follows:

[root@localhost src]# echo $LANG
zh_CN.UTF-8

 This is because we choose when installing Linux is a Chinese installation, so the default language of the main variables "zh_CN.UTF-8".

How many query languages ​​supported Linux system:

[root @ localhost src] # locale -a | More 
aa_DJ 
aa_DJ.iso88591 
aa_DJ.utf8 
aa_ER 
... output omitted ... 

# query language the
[root @ localhost src] # locale -a | WC the -l
735

View the current language used by the system:

[root@localhost src]# locale
LANG=zh_CN.UTF-8
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8n
LC_NAME="zh_CN.U 丁 F-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8n
LC_MEASUREMENT="zh_CN.U 丁 F-8"
LC_IDENTIFICATI0N=Mzh_CN.UTF-8M
LC_ALL= 

In the Linux system, the language mainly LANG and LC_ALL variables, other variables will depend on the value of these two variables and changes.

     LANG main language definition system variables,

     LC_ALL overall definition language variables, is generally used to define the system variable LANG language.

We also by default languages file / etc / sysconfig / i18n define the system, look at this document, as follows:

[root@localhost src]# cat /etc/sysconfig/i18n
LANG="zh_CN.UTF-8" 

 

The current language the default language:

  The default language is the language after the next system restart is used;

  The current system language is the language used by the current system.

    If the system is restarted, it will read from the default language configuration file / etc / sysconfig / i18n in language, and then assigned to the variable LANG, let this language to take effect. In other words, language LANG variable definition only takes effect on the current system; permanent order, we must modify / etc / sysconfig / i18n file.

Here, we need to explain the issue support the Chinese Linux. As long as the language is not defined as the Chinese language, as zh_CN.UTF-8, you can correctly display Chinese of it? This situation should be divided, if it is in the graphical interface, or using a remote connection tools (such as SecureCRT, Xshell, etc.), then, as long as the language is set correctly, it can display Chinese correctly. Of course, remote access tool also configure the correct language environment.

If it is pure character interface (local terminal tty1 ~ tty6), it can not show the Chinese, because Linux is pure character interface can not display such a complex coding of Chinese. If you have to display Chinese characters in pure interface, you can only install Chinese plug-ins, such as zhcon and so on.

For example, take a look at the Chinese Show remote connection tool, as follows:

[raot the src @ localhost] $ # echo the LANG 
zh_CN.UTF. 8- 
# remote connection tools currently used, as long as the language is correct, can be properly displayed Chinese 
[root @ localhost src] # df 
file system block 1K- Used Avail% with mount point 
/ dev / sda3 1813532 17,097,616 19,923,216 10% / 
tmpfs 312 672 312 672 0 0% / dev / SHM 
/ dev / sda1 198337 26359 161 738 15% / Boot 
# using the df command can see normally displayed in Chinese

 But if it is a pure character interface? Although Chinese Linux is installed, but the pure character based languages ​​is "en_US.UTF ~ 8", as shown in FIG.


Pure character interface languages ​​1

We change the language to Chinese, to see what the situation will be as shown in Fig.



Figure 2 pure character set Chinese language interface


If we have to set up Chinese language in the pure character interface, will be garbled. How to solve it? Installation zhcon Chinese plug can be solved, the installation is not complicated, inquiries about installation instructions can be easily installed.

Guess you like

Origin www.cnblogs.com/kaishirenshi/p/12218245.html