Page 1 of 1

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

Posted: Sun Aug 26, 2018 9:47
by t96v
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.

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

Posted: Sun Aug 26, 2018 22:09
by Fitzcarraldo
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.

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

Posted: Mon Aug 27, 2018 0:50
by t96v
now everything is ok.
thanks for your help.