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
t96v
Baby Hen
Posts: 2
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 0.8.7.4.

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.

User avatar
Fitzcarraldo
Sagely Hen
Posts: 8116
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom
Contact:

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.GBK GBK
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
zh_CN.gb18030
zh_CN.gb2312
zh_CN.gbk
zh_CN.utf8
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.

t96v
Baby Hen
Posts: 2
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