You are not logged in.

#1 2012-12-31 17:55:58

miek
Member
Registered: 2012-09-03
Posts: 25
Website

[Solved] Can't find what messes up my locales

Hi,

First of all, I'd like to say that I did follow the beginner's guide and the locale wiki entry before posting here. I spents many hours trying to correct the issue myself but I can't think of anything but ugly fixes now...

Please note that I've done a few adjustments after the initial installation to try and fix my locale. For example, my /etc/locale.conf initially didn't include anything else than LANG and LC_COLLATE, but I've added other options to try and fix them (no success).

The global locale that I want to use is en_CA.UTF-8. I've enabled it in /etc/locale.gen and generated it with locale-gen, and here's the output of:

$ locale -a
C
POSIX
en_CA.utf8

Here's my locale.conf:

$ cat locale.conf
LANG="en_CA.UTF-8"
LC_COLLATE="C"

# Added afterwards
LC_CTYPE="en_CA.UTF-8"
LC_NUMERIC="en_CA.UTF-8"
LC_TIME="en_CA.UTF-8"
LC_MONETARY="en_CA.UTF-8"
LC_MESSAGES="en_CA.UTF-8"
LC_PAPER="en_CA.UTF-8"
LC_NAME="en_CA.UTF-8"
LC_ADDRESS="en_CA.UTF-8"
LC_TELEPHONE="en_CA.UTF-8"
LC_MEASUREMENT="en_CA.UTF-8"
LC_IDENTIFICATION="en_CA.UTF-8"

I've also copied this /etc/locale.conf to ~/.config/locale.conf, but nothing changed. I looked at /etc/profile.d/locale.sh to see what other script might change my locales after startup but I couldn't find anything else. Here's what I get when I run "locale" in bash:

$ locale
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_CA.UTF-8
LC_CTYPE=en_CA.UTF-8
LC_NUMERIC=fr_CA.utf8
LC_TIME=fr_CA.utf8
LC_COLLATE=C
LC_MONETARY=fr_CA.utf8
LC_MESSAGES=en_CA.UTF-8
LC_PAPER=en_CA.UTF-8
LC_NAME=en_CA.UTF-8
LC_ADDRESS=en_CA.UTF-8
LC_TELEPHONE=en_CA.UTF-8
LC_MEASUREMENT=fr_CA.utf8
LC_IDENTIFICATION=en_CA.UTF-8
LC_ALL=

So the problem is that a few locales are set to fr_CA.ut8, which isn't enabled and doesn't even correspond to the locale.gen entry (it would've to be fr_CA.UTF-8). Several applications report that they cannot find the locale so I'd really like to correct that. Also several characters fail to show up correctly in bash (man pages, htop, bash itself, etc.). For example:

$ man locale
man: can't set the locale; make sure $LC_* and $LANG are correct

I have no rc.conf or rc.local in /etc. There also isn't anything in /etc/bash.bashrc or ~/.bashrc regarding locales, and I don't see what else could affect it. /etc/profile doesn't, I don't have any ~/.profile... I'm quite lost.

I've also tried going back to the base configuration shown in the beginner's guide, so no ~/.config/locale.conf and only LANG and LC_COLLATE in /etc/locale.conf, but I get the same results.

I know I could export these values in other startup scripts but it seems like an ugly fix to me and I'd like to correct the problem at its root. I don't believe there's any relevant log file. Could you please help me fix this?

Thank you,

Last edited by miek (2013-01-01 01:02:29)

Offline

#2 2012-12-31 18:04:24

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,423
Website

Re: [Solved] Can't find what messes up my locales

Hmm... post the output of:

% sed '/#/d' /etc/locale.gen

CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3 2012-12-31 18:09:38

miek
Member
Registered: 2012-09-03
Posts: 25
Website

Re: [Solved] Can't find what messes up my locales

Here it is:

$ sed '/#/d' /etc/locale.gen
en_CA.UTF-8 UTF-8

Offline

#4 2012-12-31 18:18:30

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,423
Website

Re: [Solved] Can't find what messes up my locales

OK... out of ideas tongue

My setup has always included that file followed by `locale-gen` as well as setting up /etc/locale.conf as you have.

 % cat /etc/locale.conf
LANG=en_US.utf8
LC_COLLATE=C

% sed '/#/d' /etc/locale.gen
en_US.UTF-8 UTF-8

Last edited by graysky (2012-12-31 18:20:29)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#5 2012-12-31 18:25:10

miek
Member
Registered: 2012-09-03
Posts: 25
Website

Re: [Solved] Can't find what messes up my locales

I wonder if Gnome's overriding it... I'll look into it. Thanks.

Offline

#6 2012-12-31 18:30:11

bgc1954
Member
From: Edmonton, AB, Canada
Registered: 2006-03-14
Posts: 1,119

Re: [Solved] Can't find what messes up my locales

Maybe a shot in the dark and it may not do anything but in my /etc/locale.conf--as well as that posted in the beginners guide--you do not use quotes around the entries.

$ cat /etc/locale.conf
LANG=en_US.UTF-8
LC_COLLATE=C

unless you have some uninteded typo in your post.

Last edited by bgc1954 (2012-12-31 18:30:35)


Time is a great teacher, but unfortunately it kills all its pupils ... - Louis Hector Berlioz

Offline

#7 2012-12-31 18:34:51

miek
Member
Registered: 2012-09-03
Posts: 25
Website

Re: [Solved] Can't find what messes up my locales

I did try using it with and without quotes and it didn't seem to change anything. I'm quite sure this was caused by Gnome now, I looked at the "Region & Language" settings in Gnome's preferences and the formats are set to a mix of en_CA and fr_CA, quite like my output of "locale". I'll correct it via the menu and try to find the related config file afterwards, though I must wait for some compilation to complete...

Offline

#8 2012-12-31 18:39:26

bgc1954
Member
From: Edmonton, AB, Canada
Registered: 2006-03-14
Posts: 1,119

Re: [Solved] Can't find what messes up my locales

Don't tell anyone--it's a secret.  Alot of people eventually figure things out for themselves--if they really think their problem through. wink

That's another reason I'm not partial to the big DE's.  They sometimes have alot of hidden things that take over from your original preferences/settings.


Time is a great teacher, but unfortunately it kills all its pupils ... - Louis Hector Berlioz

Offline

#9 2013-01-01 01:04:07

miek
Member
Registered: 2012-09-03
Posts: 25
Website

Re: [Solved] Can't find what messes up my locales

Marked my post as Solved, it was Gnome messing up my locale. I think I'll either go back to openbox or try i3, I don't like how Gnome overrides my configuration files...

Thank you for your time!

Offline

#10 2013-04-13 20:50:52

viktordick
Member
Registered: 2012-03-19
Posts: 14

Re: [Solved] Can't find what messes up my locales

Sorry for replying after the topic was closed, but did you find what files gnome is saving the language settings in? I want to have LC_DATE different from LC_MONETARY, for example, and the dialag does not provide a possibility to distinguish them. I set this in /etc/locale.conf, but gnome seems to overwrite these settings.

Last edited by viktordick (2013-04-13 20:51:37)

Offline

#11 2013-04-14 13:41:01

miek
Member
Registered: 2012-09-03
Posts: 25
Website

Re: [Solved] Can't find what messes up my locales

Sorry, can't say I have. I removed Gnome for this reason and a few others and now use i3 instead. I'd look into Gnome's documentation to find where it stores its configuration files and see if there are more options than those provided by the dialog (certainly). My guess would be in either ~/.config/gnome or ~/.gnome, but I really can't say without doing some research.

Offline

Board footer

Powered by FluxBB