I. Introduction
Those who are not accustomed to English may want to convert the system from English to Chinese; and those who consider that the Chinese directory may be garbled if the client is not configured correctly, they may prefer to convert the system from Chinese to English.
Switching Chinese to English actually means changing the value of LANG from zh_CN-UTF8 character set to en_US-UTF8 character set; similarly, switching from English to Chinese means changing the value of LANG from en_US-UTF8 to zh_CN-UTF8.
This article only uses switching from Chinese to English as an example.
2. Change the Chinese environment to the English environment
The current desktop is displayed as follows:
The user's home directory is displayed as follows:
2.1 Use locale to view the currently used encoding and character set
locale
2.2 Use locale -a to view the currently supported encoding and character set
locale -a | grep en_US #locale -a will output all encodings and character sets supported by the current system, so I use grep here to filter only en_US character set
You can see en_US.utf8. Be careful not to directly use the en_US.utf8 here in the next modification, but write it in the form of en_US.UTF-8, otherwise the modification will not take effect and the system will continue to use the original Chinese encoding.
2.3 Modify the LANG variable in /etc/profile
echo 'export LANG=en_US.UTF-8'>>/etc/profile #in/etc/profile last append
reboot #Restart the operating system
2.4 Confirm to modify the folder from Chinese to English
Use the graphical interface to log in to the host, the rename confirmation interface appears, click OK
Three, description
3.1 Some tutorials say that you can directly execute export LANG=en_US.UTF-8
, is this really feasible?
Answer: Not feasible. At least it is not feasible in my test. And from the principle point of view, this is an obvious way of dynamic modification, the impact can only be applied to the current session-and only the prompt information of the terminal has changed from Chinese to English, and the interface and directory are still in Chinese-leaving the current session or restarting the system and returning to the original Chinese too.
3.2 There is a tutorial saying that you can modify /etc/sysconfig/i18n
, is this feasible?
Answer: According to the test on CentOS-6.8 and Redhat-6.5, the prompt in the terminal changed from Chinese to English in /etc/sysconfig/i18n, but the interface and directory cannot be changed to English. (But it seems that the /etc/sysconfig/i18n directory can be changed when English is changed to Chinese)
The test shows that /etc/profile has a higher priority than /etc/sysconfig/i18n.
3.3 Is the directory really changed from Chinese to English, for example, "Desktop" is really changed to "Desktop", and then the file originally in "Desktop" is changed to "Desktop"?
Answer: According to actual operation, "Desktop" and "Desktop" are two folders.
When the Chinese environment is set, the graphical interface displays the "Desktop" folder; when the English environment is set, the graphical interface displays the "Desktop" folder. The original files on the "Desktop" will not be automatically saved to "Desktop", but will be saved in " Desktop" folder.
to sum up
The above is the CentOS6.8 Chinese/English environment switching tutorial diagram introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message. The editor will reply to you in time. Thank you very much for your support to the ZaLou.Cn website!
If you think this article is helpful to you, welcome to reprint, please indicate the source, thank you!
Recommended Posts