Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Locale error
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
reppk
n00b
n00b


Joined: 17 Mar 2016
Posts: 25

PostPosted: Wed Feb 15, 2017 3:01 pm    Post subject: Locale error Reply with quote

Hello, everyone!

I used to use zh_TW.UTF-8 as my locale setting. Several days ago, I found that I can't use my locale anymore. My GUI language changed into English as well.

The error message looks like this:
Code:
bash: warning: setlocale: LC_ALL: cannot change locale (zh_TW.utf8)


This is the result from "eselect locale list":
Code:
# eselect locale list 
Available targets for the LANG variable:
  [1]   C
  [2]   POSIX
  [3]   zh_TW.UTF-8 *
  [ ]   (free form)

Almost all of locales disappeared!

What can I do to fix it?
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Wed Feb 15, 2017 3:38 pm    Post subject: Reply with quote

reppk ...

please post the output of the following:

Code:
# egrep -v '(^#|^$)' /etc/locale.gen
# locale -a
# locale

best ... khay
Back to top
View user's profile Send private message
reppk
n00b
n00b


Joined: 17 Mar 2016
Posts: 25

PostPosted: Thu Feb 16, 2017 2:18 pm    Post subject: Reply with quote

Here is the result:
Code:
# egrep -v '(^#|^$)' /etc/locale.gen
ja_JP.EUC-JP EUC-JP
ja_JP.UTF-8 UTF-8
ja_JP EUC-JP
ja_JP.SJIS SJIS
zh_TW.UTF-8 UTF-8
zh_TW.BIG5 BIG5
zh_CN.UTF-8 UTF-8
zh_CN.GB2312 GB2312

# locale -a
C
POSIX

# locale   
LANG=C
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE=C
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEP# locale   
LANG=C
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE=C
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=
HONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Thu Feb 16, 2017 2:23 pm    Post subject: Reply with quote

reppk wrote:
Code:
# locale -a
C
POSIX

reppk ... run the following (as root)

Code:
# locale-gen
# source /etc/profile
# locale -a
# locale

HTH & best ... khay
Back to top
View user's profile Send private message
reppk
n00b
n00b


Joined: 17 Mar 2016
Posts: 25

PostPosted: Thu Feb 16, 2017 4:27 pm    Post subject: Reply with quote

Code:
# locale-gen
 * Generating locale-archive: forcing # of jobs to 1
 * Generating 8 locales (this might take a while) with 1 jobs
 *  (1/8) Generating ja_JP.EUC-JP ...                                     [ !! ]
 *  (2/8) Generating ja_JP.EUC-JP ...                                     [ !! ]
 *  (3/8) Generating ja_JP.SJIS ...
character map file `SJIS' not found: No such file or directory            [ !! ]
 *  (4/8) Generating ja_JP.UTF-8 ...                                      [ !! ]
 *  (5/8) Generating zh_CN.GB2312 ...                                     [ !! ]
 *  (6/8) Generating zh_CN.UTF-8 ...                                      [ !! ]
 *  (7/8) Generating zh_TW.BIG5 ...                                       [ !! ]
 *  (8/8) Generating zh_TW.UTF-8 ...                                      [ !! ]
 * Generation complete

# source /etc/profile
# locale -a
C
POSIX

# locale   
LANG=C
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE=C
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=


Nothing changed.

PS: BTW, I use systemd.
Back to top
View user's profile Send private message
Fitzcarraldo
Advocate
Advocate


Joined: 30 Aug 2008
Posts: 2034
Location: United Kingdom

PostPosted: Thu Feb 16, 2017 4:54 pm    Post subject: Reply with quote

reppk wrote:
PS: BTW, I use systemd.

That's a big "BTW"!

I'm not sure if it will help you, but below is how I set up the time zone and locale in a distribution that uses systemd:

1. Listed the available time zones:
Code:
# timedatectl list-timezones

(Pressed the Space Bar to page through the list, and the Q key to exit the list.)

2. Specified the timezone I wanted:
Code:
# timedatectl set-timezone America/Sao_Paulo


3. Listed the current locale:
Code:
# localectl list-locales
en_US
en_US.iso88591
en_US.utf8


4. I wanted to change the current locale and also add a locale, so I edited the locale.gen file:
Code:
# nano /etc/locale.gen


I wanted to have just British English and Brazilian Portuguese, so I made the file contain only the following:
Code:
en_GB.UTF-8 UTF-8
en_GB ISO-8859-1
pt_BR.UTF-8 UTF-8
pt_BR ISO-8859-1


If I had only wanted one language (I’ll use Brazilian Portuguese as an example), I would have made it contain the following instead:
Code:
pt_BR.UTF-8 UTF-8
pt_BR ISO-8859-1


5. Generated the locale(s):
Code:
# locale-gen
* Generating 4 locales (this might take a while) with 1 jobs
* (1/4) Generating en_GB.UTF-8 ... [ ok ]
* (2/4) Generating en_GB.ISO-8859-1 ... [ ok ]
* (3/4) Generating pt_BR.UTF-8 ... [ ok ]
* (4/4) Generating pt_BR.ISO-8859-1 ... [ ok ]
* Generation complete


6. Listed the locales I had configured, just to be sure:
Code:
# localectl list-locales
en_GB
en_GB.iso88591
en_GB.utf8
pt_BR
pt_BR.iso88591
pt_BR.utf8


7. Set the language I wanted to use:
Code:
# localectl set-locale LANG=pt_BR.UTF-8


8. Listed the console keymaps available:
Code:
# localectl list-keymaps


9. Chose the console keymap I wished to use:
Code:
# localectl set-keymap br-abnt2

N.B. The above systemd command did not change the console keymap specified in /boot/grub/grub.cfg, which remained as “vconsole.keymap=us“. I fixed that later by editing /etc/default/grub and running grub2-mkconfig -o /boot/grub/grub.cfg, as I show further on.

10. Listed the X11 keymaps available:
Code:
# localectl list-x11-keymap-layouts


11. Chose the X11 keymap I wished to use:
Code:
# localectl set-x11-keymap br


12. Updated the environment variables and profile to adopt what I had specified:
Code:
# env-update && source /etc/profile


13. Rebooted:
Code:
# systemctl reboot


14. Logged-in as the root user.

15. Fixed the console keymap specified in grub.cfg:
Code:
# nano /etc/default/sabayon-grub


and replaced “vconsole.keymap=us” with “vconsole.keymap=br-abnt2“. Then regenerate grub.cfg:
Code:
# grub2-mkconfig -o /boot/grub/grub.cfg


16. If you use KDE, you'll also need to install the KDE internationalisation package:

In my case, I would have the following in /etc/portage/make.conf:
Code:
# grep "LINGUAS\|L10N" /etc/portage/make.conf
LINGUAS="en en_GB pt_BR"
L10N="en en-GB pt-BR"

Code:
# emerge kde-l10n

_________________
Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC udev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Thu Feb 16, 2017 6:08 pm    Post subject: Reply with quote

reppk wrote:
PS: BTW, I use systemd.

reppk ... you might have said this at the outset, then I would know not to waste my time.

best ... khay
Back to top
View user's profile Send private message
reppk
n00b
n00b


Joined: 17 Mar 2016
Posts: 25

PostPosted: Fri Feb 17, 2017 1:46 pm    Post subject: Reply with quote

Sorry, I forgot most of gentoo users still using openrc.

Code:
# locale-gen
 * Generating locale-archive: forcing # of jobs to 1
 * Generating 8 locales (this might take a while) with 1 jobs
 *  (1/8) Generating ja_JP.EUC-JP ...                                     [ !! ]
 *  (2/8) Generating ja_JP.EUC-JP ...                                     [ !! ]
 *  (3/8) Generating ja_JP.SJIS ...
character map file `SJIS' not found: No such file or directory            [ !! ]
 *  (4/8) Generating ja_JP.UTF-8 ...                                      [ !! ]
 *  (5/8) Generating zh_CN.GB2312 ...                                     [ !! ]
 *  (6/8) Generating zh_CN.UTF-8 ...                                      [ !! ]
 *  (7/8) Generating zh_TW.BIG5 ...                                       [ !! ]
 *  (8/8) Generating zh_TW.UTF-8 ...                                      [ !! ]
 * Generation complete

Does this mean locale-gen failed?

I tried localectl command, but it still not work.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum