You are not logged in.

#1 2012-04-11 13:34:54

chrlin
Member
Registered: 2011-12-18
Posts: 15

Cannot change locale

I've been looking around the wiki for some time, but I cannot find the answer that can solve my question
I'm trying to use Traditional Chinese as my locale, but cannot change it.

So here you go

/etc/rc.conf

#
# /etc/rc.conf - Main Configuration for Arch Linux
#
# See 'man 5 rc.conf' for more details
#

# LOCALIZATION
# ------------
HARDWARECLOCK="localtime"
TIMEZONE="Asia/Taipei"
KEYMAP="us"
CONSOLEFONT=
CONSOLEMAP=
LOCALE="zh_TW.UTF8"
DAEMON_LOCALE="yes"
USECOLOR="yes"

# HARDWARE
# --------
MODULES=()
USEDMRAID="no"
USEBTRFS="no"
USELVM="no"

# NETWORKING
# ----------
HOSTNAME=

interface=eth0
address=
netmask=
broadcast=
gateway=

NETWORK_PERSIST="no"

# DAEMONS
# -------
#
DAEMONS=(@syslog-ng @network)

locale-gen, of course after editing /etc/locale.gen

$ sudo locale-gen
Generating locales...
  zh_TW.UTF-8... done
Generation complete.

locale -a after locale-gen

$ locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
POSIX
zh_TW.utf8

try exporting environmental variables

$ export LC_CTYPE=zh_TW.UTF8
bash: warning: setlocale: LC_CTYPE: cannot change locale (zh_TW.UTF8): No such file or directory
$ export LC_CTYPE="zh_TW.UTF8"
bash: warning: setlocale: LC_CTYPE: cannot change locale (zh_TW.UTF8)

$ export LC_ALL="zh_TW.UTF8"
bash: warning: setlocale: LC_ALL: cannot change locale (zh_TW.UTF8): No such file or directory
$ export LC_ALL=zh_TW.UTF8
bash: warning: setlocale: LC_ALL: cannot change locale (zh_TW.UTF8)

this is rather interesting, note that when exporting LC_TYPE, bash accepted the name inside double quotes, but when exporting LC_ALL, bash accepted the name without double quotes.
But I don't know if this have something to do with the real problem.

Another interesting thing is that I go to tty1 (ctrl+alt+F1) log in with root account, and everything is fine.
(the code below is typed by myself based on the output in tty1,because I don't know how to copy the content of tty1)

#locale -a
C
POSIX
zh_TW.utf8
#export LC_ALL=zh_TW.UTF8

After this post I'll try to mess up with the root's setting and perhaps looking if there is a user group called locale
(which I'm certain my username is not within it)
Thanks in advance for any reply and suggestion


The Arch Way - The Meaning of System - The Flow of Data - The Layer of Abstraction - The Power of Root - The Law of Command - The Communication of Terminal - The Union of Man and Machine

上之道 - 生之義 - 氣之流 - 天之層 - 活之力 - 命之理 - 靈之通 - 天人合一

Offline

#2 2012-04-11 13:40:57

chrlin
Member
Registered: 2011-12-18
Posts: 15

Re: Cannot change locale

Alright just tried this, go to tty1, login with my account and everything is fine.

$locale -a
C
POSIX
zh_TW.UTF8
$export LC_ALL=zh_TW.UTF-8

so this has something to do with runlevel... On runlevel 3 everything is fine, but on runlevel 5 something is wrong.
My DE is SLiM + Openbox + tint2 and I can't think of anything wrong with my installation procedure or something.
Of course, Chinese input method is also not working, and my instinct says that it has something to do with this.


The Arch Way - The Meaning of System - The Flow of Data - The Layer of Abstraction - The Power of Root - The Law of Command - The Communication of Terminal - The Union of Man and Machine

上之道 - 生之義 - 氣之流 - 天之層 - 活之力 - 命之理 - 靈之通 - 天人合一

Offline

#3 2012-04-13 05:17:32

chrlin
Member
Registered: 2011-12-18
Posts: 15

Re: Cannot change locale

Alright the problem is solved...

The truth that the problem is only on runlevel 5 and that there is no problem in runlevel 3, so I guess it has something to do with the GUI, either Openbox or SLiM. After some research, I found out that it has something to do with SLiM

set /etc/environment

#
# This file is parsed by pam_env module
#
# Syntax: simple "KEY=VAL" pairs on separate lines
#
LANG=ja_JP.UTF8
LC_CTYPE="ja_JP.UTF8"
LC_NUMERIC="ja_JP.UTF8"
LC_TIME="ja_JP.UTF8"
LC_COLLATE="ja_JP.UTF8"
LC_MONETARY="ja_JP.UTF8"
LC_MESSAGES="ja_JP.UTF8"
LC_PAPER="ja_JP.UTF8"
LC_NAME="ja_JP.UTF8"
LC_ADDRESS="ja_JP.UTF8"
LC_TELEPHONE="ja_JP.UTF8"
LC_MEASUREMENT="ja_JP.UTF8"
LC_IDENTIFICATION="ja_JP.UTF8"
LC_COLLATE="C"

after setting /etc/environment, we can change the language to whatever we want.
https://wiki.archlinux.org/index.php/SL … _Variables

Last edited by chrlin (2012-04-13 05:19:02)


The Arch Way - The Meaning of System - The Flow of Data - The Layer of Abstraction - The Power of Root - The Law of Command - The Communication of Terminal - The Union of Man and Machine

上之道 - 生之義 - 氣之流 - 天之層 - 活之力 - 命之理 - 靈之通 - 天人合一

Offline

#4 2012-04-13 08:19:09

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: Cannot change locale

Good to hear you managed to solve the issue.

Don't forget to mark your thread as [SOLVED].


Burninate!

Offline

Board footer

Powered by FluxBB