You are not logged in.

#1 2016-07-03 05:51:19

Ketchup901
Member
Registered: 2016-05-18
Posts: 47

[Solved] How do you set locale properly?

Every time I install some programs, it tells me at the end: "mandb: can't set the locale; make sure $LC_* and $LANG are correct"

And also when I try to launch anki (https://www.archlinux.org/packages/community/any/anki/) it says that it only supports UTF-8 locales.

When opening emacs, it tells me this:

(process:2398): Gtk-WARNING **: Locale not supported by C library.
        Using the fallback 'C' locale.

This is my locale.gen: https://p.teknik.io/sE5tD (only "en_US.UTF-8 UTF-8" and "sv_SE.UTF-8" are uncommented) and my /etc/locale.conf looks like this:

LANG=en_US.UTF-8

Last edited by Ketchup901 (2016-07-24 10:34:22)

Offline

#2 2016-07-03 09:23:57

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: [Solved] How do you set locale properly?

did you also run 'locale-gen' to generate the locales, and also set the locales correctly in locale.conf?
you can check your current locale settings by running 'locale'

https://wiki.archlinux.org/index.php/Locale

Offline

#3 2016-07-03 15:30:22

Ketchup901
Member
Registered: 2016-05-18
Posts: 47

Re: [Solved] How do you set locale properly?

ooo wrote:

did you also run 'locale-gen' to generate the locales, and also set the locales correctly in locale.conf?
you can check your current locale settings by running 'locale'

https://wiki.archlinux.org/index.php/Locale

Well that's weird, output of locale is this:

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_ALL to default locale: No such file or directory
LANG=smj_SE.UTF-8
LC_CTYPE="smj_SE.UTF-8"
LC_NUMERIC="smj_SE.UTF-8"
LC_TIME="smj_SE.UTF-8"
LC_COLLATE="smj_SE.UTF-8"
LC_MONETARY="smj_SE.UTF-8"
LC_MESSAGES="smj_SE.UTF-8"
LC_PAPER="smj_SE.UTF-8"
LC_NAME="smj_SE.UTF-8"
LC_ADDRESS="smj_SE.UTF-8"
LC_TELEPHONE="smj_SE.UTF-8"
LC_MEASUREMENT="smj_SE.UTF-8"
LC_IDENTIFICATION="smj_SE.UTF-8"
LC_ALL=

Running "localectl set-locale LANG=en_US.UTF-8" does nothing, the output is still the same, also running locale-gen doesn't change anything.
This locale "smj_SE.UTF-8" is not even in locale.gen.

Offline

#4 2016-07-03 17:12:52

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [Solved] How do you set locale properly?

You must have smj_SE.UTF-8 configured somewhere, it wouldn't be configured like that by magic, how did you install Arch and which steps have you followed to configure your locale?


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#5 2016-07-03 17:33:48

Ketchup901
Member
Registered: 2016-05-18
Posts: 47

Re: [Solved] How do you set locale properly?

R00KIE wrote:

You must have smj_SE.UTF-8 configured somewhere, it wouldn't be configured like that by magic, how did you install Arch and which steps have you followed to configure your locale?

I just installed it according to the beginner's guide, or what do you mean? I don't know how I would have it configured elsewhere because I don't know of any ways to configure locale other than putting them in locale.gen and running locale-gen. Although what other places could it be configured in?

Offline

#6 2016-07-03 17:38:21

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: [Solved] How do you set locale properly?

your desktop environment could also be setting your locale, at least gnome does that.

Offline

#7 2016-07-03 18:14:06

Ketchup901
Member
Registered: 2016-05-18
Posts: 47

Re: [Solved] How do you set locale properly?

ooo wrote:

your desktop environment could also be setting your locale, at least gnome does that.

That's it, KDE Plasma is setting it, I'll change that and cross my fingers.

Offline

#8 2016-07-03 20:51:55

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [Solved] How do you set locale properly?

Ketchup901 wrote:
R00KIE wrote:

You must have smj_SE.UTF-8 configured somewhere, it wouldn't be configured like that by magic, how did you install Arch and which steps have you followed to configure your locale?

I just installed it according to the beginner's guide, or what do you mean? I don't know how I would have it configured elsewhere because I don't know of any ways to configure locale other than putting them in locale.gen and running locale-gen. Although what other places could it be configured in?

Locale.gen is used to specify which locale files will be generated/built. Locale configuration goes into /etc/locale.conf.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#9 2016-07-04 06:28:33

Ketchup901
Member
Registered: 2016-05-18
Posts: 47

Re: [Solved] How do you set locale properly?

Alright so setting the locale in KDE worked and I can launch anki now, but the mandb thing still appears when installing or updating programs.

R00KIE wrote:
Ketchup901 wrote:
R00KIE wrote:

You must have smj_SE.UTF-8 configured somewhere, it wouldn't be configured like that by magic, how did you install Arch and which steps have you followed to configure your locale?

I just installed it according to the beginner's guide, or what do you mean? I don't know how I would have it configured elsewhere because I don't know of any ways to configure locale other than putting them in locale.gen and running locale-gen. Although what other places could it be configured in?

Locale.gen is used to specify which locale files will be generated/built. Locale configuration goes into /etc/locale.conf.

I know, I posted the locale.conf in the OP.

Offline

#10 2016-07-04 10:44:25

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: [Solved] How do you set locale properly?

Ketchup901 wrote:

Alright so setting the locale in KDE worked and I can launch anki now, but the mandb thing still appears when installing or updating programs.

What's the output of 'locale' now?

Offline

#11 2016-07-04 12:45:24

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [Solved] How do you set locale properly?

Ketchup901 wrote:

I know, I posted the locale.conf in the OP.

I missed that, my bad smile

You should also check /etc/profile.d/* and/or any configuration files sourced by your shell as those can also change the locale configuration.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#12 2016-07-06 19:05:47

Ketchup901
Member
Registered: 2016-05-18
Posts: 47

Re: [Solved] How do you set locale properly?

ooo wrote:
Ketchup901 wrote:

Alright so setting the locale in KDE worked and I can launch anki now, but the mandb thing still appears when installing or updating programs.

What's the output of 'locale' now?

Actually it doesn't give me that error after changing date display settings in KDE from "en_SE" to "sv_SE". This is a minor inconvenience because I prefer having my date displayed in Swedish format but in English words, but I can't stand error messages, so I just switched to sv_SE.
And yeah I can't use en_SE because it does not exist in locale.gen.
If you still want the output of locale, here it is:

LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=sv_SE.UTF-8
LC_TIME=sv_SE.UTF-8
LC_COLLATE=sv_SE.UTF-8
LC_MONETARY=sv_SE.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=sv_SE.UTF-8
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Offline

#13 2016-07-06 19:30:35

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: [Solved] How do you set locale properly?

Ketchup901 wrote:

This is a minor inconvenience because I prefer having my date displayed in Swedish format but in English words, but I can't stand error messages, so I just switched to sv_SE.

I'm using LC_TIME=en_GB.UTF-8 for that same reason.

Offline

Board footer

Powered by FluxBB