How do I change my LC_* settings in GNOME within my user's locale?

Asked by Andrew Conkling on 2009-02-12

My general locale is en_US.UTF-8, but as I prefer 24-hour clocks and starting my week on Monday, I'd like to use en_DK.UTF-8 for my LC_TIME environment variable.

How do I set that to be available to GNOME just for my user?

Adding "LC_TIME=en_DK.UTF-8" to my shell's rc (~/.zshrc, and ~/.bashrc too) does not work. The only way I've gotten it to work is to add "LC_TIME=en_DK.UTF-8" to /etc/environment, but that sets it for all users.

(Also see related question #6311 and bug #306591, the latter of which I had filed assuming a bug. But I was advised this could be a support question also.)

Question information

Language:
English Edit question
Status:
Solved
For:
GNOME Common Edit question
Assignee:
No assignee Edit question
Solved by:
Lesmana Zimmer
Solved:
2009-05-26
Last query:
2009-05-26
Last reply:
2009-04-23
Launchpad Janitor (janitor) said : #1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Andrew Conkling (andrewski) said : #2

Unanswered.

Best Lesmana Zimmer (lesmana) said : #3

i have this done in my .profile file. here are the relevant lines from my .profile file:

## everything is set to german (datum, uhrzeit, komma, euro)
export LANG=de_DE.utf8
## programs still talk to me in english
export LC_MESSAGES=en_US.utf8
## sort order based on ASCII order
export LC_COLLATE=C

some background explanation: gdm parses .profile (see /etc/gdm/Xsession). gdm also parses .xprofile, but i wanted the LC_* settings for bash and for gnome, so i put it in .profile. the .profile file is read by gnome and by bash if bash is started as a login shell (check the bash manual for an explanation of what a login shell is, generally if you just typed your username and password then it is a login shell). in the standard .profile file provided by ubuntu there is a condition which checks wether .profile is read by bash, in which case it also reads .bashrc, if not then it will not include .bashrc, so gdm will not parse .bashrc.

here is me being smartypants: bash will not read .profile if it finds a .bash_profile first (check the bash manual about startup files). i created a .bash_profile which reads .profile and then .bashrc. this way gnome can read .profile all it wants and won't collide with bash. bash itself will not read .profile because it finds a .bash_profile, which tells bash to read .profile. it's a bit weird but it feels better this way then the way ubuntu (or debian) did it with the condition in .profile.

Pieter Lexis (pieter-lexis) said : #4

I've done the same

## everything is set to dutch
export LANG=nl_NL.utf8
## programs still talk to me in english
export LC_MESSAGES=en_US.utf8

however. ccsm is partly dutch now...

And if i set
export LC_TIME=nl_NL.utf8

and nothing else the time in gnome-do isn't set correctly, but the time in evolution and nautilus are.. It kinda bugs me... Can you why this is?

Andrew Conkling (andrewski) said : #5

Thanks Lesmana Zimmer, that solved my question.

Andrew Conkling (andrewski) said : #6

At least this will be "documented" when someone searches for it later; I've posted about it almost everywhere. ;)