You are not logged in.

#1 2012-03-27 15:30:20

thms
Member
Registered: 2010-02-01
Posts: 120

LOCALE setting in rc.conf is ignored

Hi, I've found some threads here where the problem is described that Nautilus and ls (that use the locale settings) sort files case sensitive but the solutions I found seem to be out dated: https://bbs.archlinux.org/viewtopic.php?id=34699

Now, what's the correct way to avoid this behavoir?

$ locale -a
C
POSIX
de_DE
de_DE.iso88591
de_DE.iso885915@euro
de_DE.utf8
de_DE@euro
deutsch
german
$ grep LOCALE /etc/rc.conf 
LOCALE="de_DE.utf8"
DAEMON_LOCALE="yes"
$ 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=

Last edited by thms (2012-04-03 18:46:31)

Offline

#2 2012-03-27 16:03:08

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: LOCALE setting in rc.conf is ignored

I'm no expert, but I doubt 'C' is supposed to be your locale.  My output:

$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

One possible cause: if you have an /etc/locale.conf, the LANG variable in that file overrides LOCALE in rc.conf.  Otherwise, you could just set LC_COLLATE in your profile and export it.

Last edited by alphaniner (2012-03-27 16:05:39)


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#3 2012-03-27 16:05:18

thms
Member
Registered: 2010-02-01
Posts: 120

Re: LOCALE setting in rc.conf is ignored

Thanks for your reply but there's no such file

$ ls /etc/ | grep locale
locale.gen

Last edited by thms (2012-03-27 16:05:29)

Offline

#4 2012-03-27 16:13:32

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: LOCALE setting in rc.conf is ignored

Maybe check your .bash_profile and .bashrc (or equivalent) to ensure you haven't exported LANG from one of them.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#5 2012-03-27 16:17:29

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: LOCALE setting in rc.conf is ignored

LC_COLLATE is responsible for sorting.


LC_COLLATE="C" prints 'Foo' before 'bar', because 'Foo' starts with a capital letter.

export LC_COLLATE="en_US.UTF-8"

shoudl fix this.
(you can use German locale instead of en_US if you like)

Last edited by karol (2012-03-27 16:24:20)

Offline

#6 2012-03-27 16:22:22

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: LOCALE setting in rc.conf is ignored

That was pointed out in the thread he linked in the OP.  I think the important issue is why the output of locale says LANG="C" when he has LOCALE="de_DE.utf8" in his rc.conf.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#7 2012-03-27 16:26:40

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: LOCALE setting in rc.conf is ignored

Not sure what you mean

[karol@black foo4]$ export LC_COLLATE="C"
[karol@black foo4]$ ls
Foo  bar
[karol@black foo4]$ export LANG="C"
[karol@black foo4]$ ls
Foo  bar
[karol@black foo4]$ export LC_COLLATE="en_US.UTF-8"
[karol@black foo4]$ ls
bar  Foo

Offline

#8 2012-03-27 16:28:01

thms
Member
Registered: 2010-02-01
Posts: 120

Re: LOCALE setting in rc.conf is ignored

Thanks, I put 

export LC_COLLATE="de_DE.utf8"

in /etc/profile and now sorting works like I want to. Contrary to the linked thread there was no entry for  LC_COLLATE in this file.

So, there's still the question, that alphaniner points to: why is my locale setting in /etc/rc.conf ignored?

Offline

#9 2012-03-27 16:30:40

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: LOCALE setting in rc.conf is ignored

@karol

I don't mean to argue that LC_COLLATE="C" is not the cause.  But why is it - and everything else in his locale output - C?

Last edited by alphaniner (2012-03-27 16:31:03)


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#10 2012-03-27 16:35:37

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: LOCALE setting in rc.conf is ignored

alphaniner wrote:

@karol

I don't mean to argue that LC_COLLATE="C" is not the cause.  But why is it - and everything else in his locale output - C?

Ah, sure, https://bbs.archlinux.org/viewtopic.php … 6#p1078506 is still left unanswered.

Offline

#11 2012-03-27 17:50:55

thms
Member
Registered: 2010-02-01
Posts: 120

Re: LOCALE setting in rc.conf is ignored

Sorry,

$ cat .bashrc 

# Check for an interactive session
[ -z "$PS1" ] && return

alias ls='ls --color=auto'
#PS1='[\u@\h \W]\$ '
PS1="\[\u: \w\n\$ "

#tab-completionwit sudo
complete -cf sudo

#aliase
alias cp="cp -iv"
alias mv="mv -iv"
alias rm="rm -iv"
alias aur="yaourt -Su --aur"
alias Syu="yaourt -Syu"
alias Su='su -l'
$ cat .bash_profile 
. $HOME/.bashrc

#autologin
if [[ -z $DISPLAY && $(tty) = /dev/tty1 ]]; then
  exec startx
  # Could use xinit instead of startx
  #exec xinit -- /usr/bin/X -nolisten tcp
fi

Offline

#12 2012-04-03 08:35:36

thms
Member
Registered: 2010-02-01
Posts: 120

Re: LOCALE setting in rc.conf is ignored

Just want to bump this thread also the actual problem with Nautilus is solved. It's still unclear why my entry in /etc/rc.conf is ignored.

Offline

#13 2012-04-03 08:48:59

bzt
Member
From: Germany
Registered: 2010-04-11
Posts: 39

Re: LOCALE setting in rc.conf is ignored

Have you enabled your locale in /etc/locale.gen and run locale-gen according to this wiki page?

Offline

#14 2012-04-03 17:57:51

thms
Member
Registered: 2010-02-01
Posts: 120

Re: LOCALE setting in rc.conf is ignored

Yes, I did but the output of locale alqays looks like in my first post.

Offline

#15 2012-04-03 18:43:47

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: LOCALE setting in rc.conf is ignored

Maybe a change of title is in order: "LOCALE setting in rc.conf is ignored/overruled" or some such.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#16 2012-04-03 18:48:30

thms
Member
Registered: 2010-02-01
Posts: 120

Re: LOCALE setting in rc.conf is ignored

Done, thanks

For a workaround do I have to put every single line into /etc/profile or is there a one liner?

export LC_COLLATE="de_DE.utf8"
export LC_TIME="de_DE.utf8"
export LC_COLLATE="de_DE.utf8"
.
.
.

Offline

#17 2012-04-03 19:08:03

mr.MikyMaus
Member
From: disabled
Registered: 2006-03-31
Posts: 285

Re: LOCALE setting in rc.conf is ignored

as mentioned above, /etc/locale.conf overrides locale settings in rc.conf. You may use it as a workaround.


Also, as a longshot, try to change the LOCALE variable in rc.conf to match the string in /etc/locale.gen, not the one printed out by locale -a. I have it this way and it works just fine.


What happened to Arch's KISS? systemd sure is stupid but I must have missed the simple part ...

... and who is general Failure and why is he reading my harddisk?

Offline

#18 2012-04-03 20:12:09

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: LOCALE setting in rc.conf is ignored

I've found the LOCALE variable in /etc/rc.conf should exactly match the spelling that is included in locale.gen.  Otherwise, strange problems may occur.

I'm away from my Arch box, but I think locale.gen's spelling is "de_DE.UTF-8".  Somebody please check this.  If I'm correct, the line in rc.conf should be:

LOCALE="de_DE.UTF-8"

Offline

#19 2012-04-04 14:58:56

thms
Member
Registered: 2010-02-01
Posts: 120

Re: LOCALE setting in rc.conf is ignored

thisoldman wrote:

I've found the LOCALE variable in /etc/rc.conf should exactly match the spelling that is included in locale.gen.  Otherwise, strange problems may occur.

I'm away from my Arch box, but I think locale.gen's spelling is "de_DE.UTF-8".  Somebody please check this.  If I'm correct, the line in rc.conf should be:

LOCALE="de_DE.UTF-8"

That didn't change anything. The same applys to LANG=de_DE.UTF-8 in /etc/locale.conf

I now have

export LANG=de_DE.UTF-8

in my .bashrc and this works. Still wondering about the ignored setting.

/edit: Now k3b doesn't show umlauts correctly  sad

Last edited by thms (2012-04-04 15:37:06)

Offline

#20 2012-04-04 15:49:13

thms
Member
Registered: 2010-02-01
Posts: 120

Re: LOCALE setting in rc.conf is ignored

Ok, a new information: In the language settings of gnome and encoding settings in gnome-terminal the default language is always set to ansi_x3.4-1968

What is that?

When I try to add German it is set back when I go back to language settings. English is there, though but can't be chosen.

Last edited by thms (2012-04-04 15:56:46)

Offline

#21 2012-04-26 20:57:46

nuc
Member
Registered: 2012-04-26
Posts: 116

Re: LOCALE setting in rc.conf is ignored

Did you try to delete your locale.sh in /etc/profile.d/ and then reinstall initscripts?? If not then try. This solved a very similar Issue for me.

btw thisoldman was right, the correct spelling is "de_DE.UTF-8".

Offline

#22 2012-04-26 23:58:51

dontbugme
Banned
Registered: 2011-11-04
Posts: 166
Website

Re: LOCALE setting in rc.conf is ignored

nuc wrote:

Did you try to delete your locale.sh in /etc/profile.d/ and then reinstall initscripts?? If not then try. This solved a very similar Issue for me.

btw thisoldman was right, the correct spelling is "de_DE.UTF-8".


thx wink

the arch beginner's guide only says:

rm /etc/profile.d/locale.sh

without any explanation


i had the same problem (missing locale.sh) like thms but your information about reinstalling initscripts solved everything!

Last edited by dontbugme (2012-04-26 23:59:26)

Offline

#23 2012-04-27 13:51:59

nuc
Member
Registered: 2012-04-26
Posts: 116

Re: LOCALE setting in rc.conf is ignored

dontbugme wrote:

the arch beginner's guide only says:

rm /etc/profile.d/locale.sh

without any explanation


i had the same problem (missing locale.sh) like thms but your information about reinstalling initscripts solved everything!

yes, thats exactly the problem I had: I deleted locale.sh without reinstalling. wink . I had also missunderstood the wiki. Good that I'm not the only one - already blamed me for being that stupid wink

Anyway, I hope this helps thms.

EDIT: I updated the wiki

Last edited by nuc (2012-04-27 14:31:03)

Offline

Board footer

Powered by FluxBB