How to Restore Common Directories such as Desktop in Home Directories to Chinese

  html5, question

From English to Chinese before

export LANG=en_US

The pop-up window is checkedChinese = > EnglishAnd“Don’s ask me again”

Then executeexport LANG=zh_CN.UTF-8To resume displaying Chinese content

Now want to recover

~/.configThere are two files below:~/.config/user-dirs.dirsAnd~/.config/user-dirs.locale

I followuser-dirs.dirsThe prompt in the page changes the corresponding item in the page to Chinese, and then logs in again, which is invalid. I deleted the two files and logged in again. They were automatically generated again. They are still invalid.

I want to write an automated script, so I want to know, in addition to these two files, do you need to modify other files? How to modify it, thank you!

English to Chinese

export LC_ALL=zh_CN.UTF-8
xdg-user-dirs-update --force

Chinese to English

export LC_ALL=en_US.UTF-8
xdg-user-dirs-update --force

Re-open a terminal to operate, and then close it. There is no need to restore the Chinese display.


If you don’t want to be prompted to update the directory after logging in again, execute it if the current environment is Chinese.echo zh_CN > ~/.config/user-dirs.localeIn English, it is implementedecho en_US > ~/.config/user-dirs.locale.

As to why a new folder was created instead of being renamed, this design may be intentional, see: … … … …

Reference link: … … … … …