can not change locale(zh_CN.UTF-8) [Solved]

Discussion in general that pertains to Sabayon Linux - Must Pertain to Sabayon Linux

Moderator: Moderators

Post Reply
Baby Hen
Posts: 3
Joined: Fri Aug 24, 2018 4:27

can not change locale(zh_CN.UTF-8) [Solved]

Post by t96v » Sun Aug 26, 2018 9:47

can not change locale(zh_CN.UTF-8):no such file or directory

both qterminal and xfce4-terminal

exec "localectl list-locales" then nothing is returned.

exec "locale --all-locales", only POSIX and C are exist.

exec "localectl set-locale LANG="zh_CN.UTF-8" then reboot Sabayon, no error but no use.

thank you.

Sagely Hen
Posts: 8218
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: can not change locale(zh_CN.UTF-8)

Post by Fitzcarraldo » Sun Aug 26, 2018 22:09

You have not stated which spin of Sabayon Linux you are using. I assume from the terminal emulators you listed, you are using the LXQt spin.

Anyway, you first need to make sure the locale is specified in /etc/locale.gen and the locale has been generated:

Code: Select all

fitzcarraldo-pc /home/fitzcarraldo # grep -v ^# /etc/locale.gen
fitzcarraldo-pc /home/fitzcarraldo # nano /etc/locale.gen
fitzcarraldo-pc /home/fitzcarraldo # grep -v ^# /etc/locale.gen

zh_CN.GB18030 GB18030
zh_CN.GB2312 GB2312
zh_CN.UTF-8 UTF-8
fitzcarraldo-pc /home/fitzcarraldo # locale-gen
 * Generating 4 locales (this might take a while) with 1 jobs
 *  (1/4) Generating zh_CN.GB18030 ...                  [ ok ]
 *  (2/4) Generating zh_CN.GB2312 ...                   [ ok ]
 *  (3/4) Generating zh_CN.GBK ...                      [ ok ]
 *  (4/4) Generating zh_CN.UTF-8 ...                    [ ok ]
 * Generation complete
 * Adding locales to archive ...                        [ ok ]
fitzcarraldo-pc /home/fitzcarraldo # localectl list-locales
fitzcarraldo-pc /home/fitzcarraldo # localectl set-locale LANG=zh_CH.UTF-8
fitzcarraldo-pc /home/fitzcarraldo # localectl | grep -i locale
   System Locale: LANG=zh_CH.UTF-8
Additionally, do not forget to set the timezone, console keymap and X11 keymap in the correct manner: see the commands to set timezone, keymap and locale given in my old blog post, which are still relevant. Crucially, do not forget to also 'env-update && source /etc/profile' after you change locale, timezone and/or keymap.

All the above commands must be issued as the root user.

Baby Hen
Posts: 3
Joined: Fri Aug 24, 2018 4:27

Re: can not change locale(zh_CN.UTF-8)

Post by t96v » Mon Aug 27, 2018 0:50

now everything is ok.
thanks for your help.

Post Reply