From ArchWiki
(Redirected from Talk:Locale.conf)
Jump to: navigation, search


.bashrc is only used by interactive bash sessions, right? So that if you login with KDM in KDE (or GDM gnome), the whole KDE session will inherit the locale set by init->KDM and will not use the one set in .bashrc!

I guess a "source ~/.bashrc" in ~/.xprofile would solve this. —This unsigned comment is by Gdamjan (talk) 13:24, 23 June 2008‎. Please sign your posts with ~~~~!

I don't think so. I tried almost the whole day to set only LC_PAPER="de_DE.utf8". Trying this in almost every file possible (/etc/profile, .xprofile, .bashrc, /etc/rc.local) seemed to work, as I used "locale" in terminal to verify it. But this only worked for applications I started from terminal, but not for applications started from the gnome-menu. So I came to the conclusion it has something to do with gdm. After having a closer look to /etc/gdm/xsession the problem was clear. GDM probably always sets $GDM_LANG on login. When $GDM_LANG is set, xsession will unset all other LC-variables. Just commented out this part and now everything works as desired.
If this is a common and/or important problem, I will add this to the article. What do you think? -- Luetti 17:56, 8 July 2008 (EDT)
I think more information on this is missing in the article. I want to have LC_MESSAGES=C, LANG=de_DE.UTF-8 and LC_TIME=en_DK.UTF-8, but gnome seems to overwrite the settings. When I comment out the lines with GDM_LANG in /etc/gdm/Xsession, I can no longer log in. I would also appreciate it if someone who knows the role of the settings in "Region&Language" in gnome-control-center could add this to the article. Where are they saved and how do I disable them in favor of detailed settings (globally in /etc/locale.conf or locally in ~/.profile)? Viktordick (talk) 21:43, 13 April 2013 (UTC)
Close. Related section is gone and locale setting changes after systemd. --Fengchao (talk) 08:56, 7 May 2016 (UTC)


-- Moved from ArchWiki:Reports -- Alad (talk) 21:23, 21 August 2014 (UTC)

I believe [1] got it the wrong way around - some environments like GNOME write to this file (e.g, to change the language), so you shouldn't edit it manually. See [2]. -- Alad (talk) 04:04, 1 August 2014 (UTC)

I have no idea, perhaps it's better to add an Accuracy template and move this discussion to Talk:Locale. -- Kynikos (talk) 06:47, 2 August 2014 (UTC)
Locale#Other uses mentions that locale variables can be used as regular environment variables, but does not emphasize that they can be (re)defined in other config files, e.g. /etc/environment (see Environment variables#Globally. I think that ~/.pam_environment should be described in Environment variables#Per user as a user-specific alternative to /etc/environment (see pam_env(8)). -- Lahwaacz (talk) 08:09, 22 December 2014 (UTC)
I guess you mean that we should mention the fact that the locale could be defined automatically by some applications in files other than locale.confs (if setting the locale manually, a locale.conf file should always be preferred): in that case I agree.
+1 for mentioning ~/.pam_environment in Environment variables#Per user.
-- Kynikos (talk) 13:06, 22 December 2014 (UTC)
I've rewritten the section [3], see if it's OK. -- Lahwaacz (talk) 09:15, 23 December 2014 (UTC)
I like it, but I thought you wanted to amend Locale#Other uses; I don't mind one solution or the other :) -- Kynikos (talk) 12:56, 24 December 2014 (UTC)
Close. --Fengchao (talk) 09:15, 7 May 2016 (UTC)


Setting LC_MESSAGES to "C" or "POSIX" (as opposed to "en_US.UTF-8" for example), can save tens of syscalls in a simple program without any loss (since all you need is plain English anyway). It's 29 less syscalls (on my system) for a simple "ls /no/such/dir". Add this info inside? --Philomath (talk) 07:55, 2 July 2012 (UTC)

As there's only a "difference" on display of error messages (and perhaps UTF-8 file names), and even a simple `ls /usr/bin` takes 26 million CPU cycles (!) on my system, I don't see much practical value. However, setting LC_MESSAGES=C might be an alternative to LANG=en_US.UTF8 to keep system messages in english. -- Alad (talk) 16:49, 27 August 2015 (UTC)
You might get noticeable difference in performance in some corner cases depending on LC_COLLATE, but generally these all are well spent cycles. As for suggesting LC_MESSAGES=C, I don't think it's wise to potentially mix it with other values such as LC_TIME=<anything else>. Setting the system fallback by the LANG variable is a good advice. -- Lahwaacz (talk) 17:18, 27 August 2015 (UTC)
Change example debug locale to C. Close. --Fengchao (talk) 09:23, 7 May 2016 (UTC)

Create custom locale

[Moved from the main article. -- Alad (talk) 23:15, 24 February 2016 (UTC)]

Modified locales will not survive the upgrade of glibc because the relevant file is not in the backup field in the PKGBUILD. Custom locales should be created instead. -- User:Lahwaacz 08:59, 22 December 2014

Customizing locales

Locales are defined in text files located in /usr/share/i18n/locales/ and can be edited to adapt to particular needs.

After editing a locale file, do not forget to re-generate the locales for the changes to take effect after reboot.

Setting the first day of the week

In many countries the first day of the week is Monday. To adjust this, change or add the following lines:

week            7;19971130;5
first_weekday   2
first_workday   2

LC_ALL section

Regarding [4], the section was on its own because locale.conf doesn't support it (locale.conf(5)). If we want to keep LC_ALL there I think we should adapt the Locale#Supported variables heading or at least its few intro words. — Kynikos (talk) 01:56, 25 February 2016 (UTC)

Login manager missing

This article does not cover the login manager. I have my system in *German*, but my login manager is still using the *English* keyboard layout, and I don't know how to change it. Locale does not cover it, and I couldn't find anything in Display manager neither - albeit there is a comment that it is missing and *should* be linked here.

So How do I change the locale in the display manager?

--Nerdoc (talk) 04:33, 10 March 2016 (UTC)

"The" display manager, there's a few dozen of them. So which do you use? -- Alad (talk) 14:37, 10 March 2016 (UTC)