You are not logged in.

#1 2008-12-30 19:29:22

kamagurka
Member
From: Munich, Germany
Registered: 2006-02-20
Posts: 150
Website

I need LANG to be different from all the other locales, systemwide

Since I'm in Germany, I have de_DE.UTF-8 set in my locale.gen. However, this also sets LANG to same, and I really don't want to see all the abysmal german translations of all the apps. Is there a way of having all the relevant variables still set to de, but have LANG itself set to C or eng or whatever you yanks use?

EDIT:
To clarify:

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

This is what the output of locale looks right now. I'd like it to stay exactly like this, except that I want LANG to say C, POSIX or some other thing that'll make my system speak English to me. And I don't just want to do it in one shell via an export, I want it to be systemwide and stay that way forever and ever, through reboots and system crashes amen. Thank you for your input.

EDIT #2: Clarified the topic (I hope)

Last edited by kamagurka (2008-12-30 20:00:46)


I always roll 20s on my disbelieve checks.
You better believe it.

Offline

#2 2008-12-30 19:48:01

Cheesebaron
Member
From: Denmark
Registered: 2008-10-31
Posts: 65
Website

Re: I need LANG to be different from all the other locales, systemwide

What you could do is create a locale where the system speaks English to you and you can use your German keyboard and such.

Edit your /etc/locale.gen

and add en_DE.UTF-8 UTF-8 in the end and run locale-gen and use that locale for your system.

Offline

#3 2008-12-30 19:49:36

tth
Member
Registered: 2006-05-21
Posts: 12

Re: I need LANG to be different from all the other locales, systemwide

LANG is the default value for LC_* variables.  You just need to override LC_MESSAGES.

export LANG=de_DE.utf8
export LC_MESSAGE=C

Run "locale" to see what other variables are available, you may want to set LC_COLLATE to C (same as POSIX) to have "normal" sorting order.

Last edited by tth (2008-12-30 19:50:29)

Offline

#4 2008-12-30 19:55:03

kamagurka
Member
From: Munich, Germany
Registered: 2006-02-20
Posts: 150
Website

Re: I need LANG to be different from all the other locales, systemwide

Cheesebaron wrote:

What you could do is create a locale where the system speaks English to you and you can use your German keyboard and such.

Edit your /etc/locale.gen

and add en_DE.UTF-8 UTF-8 in the end and run locale-gen and use that locale for your system.

Hell, that's exactly what I'm trying to do.
However:

en_DE.UTF-8...cannot open locale definition file `en_DE': No such file or directory

tth: I'm aware of that, but I'd like the change to be permanent and systemwide...


I always roll 20s on my disbelieve checks.
You better believe it.

Offline

#5 2008-12-30 20:16:17

tth
Member
Registered: 2006-05-21
Posts: 12

Re: I need LANG to be different from all the other locales, systemwide

I think /etc/profile.d/locale.sh is the right place to set locale related environment variables.

Btw, there's no en_DE.UTF-8 locale. See /usr/share/i18n/locales/ for available locales.

Offline

#6 2008-12-30 20:20:40

kamagurka
Member
From: Munich, Germany
Registered: 2006-02-20
Posts: 150
Website

Re: I need LANG to be different from all the other locales, systemwide

tth: thanks. Do you know how I can make my system see this change without rebooting? locale-gen doesn't do it...


I always roll 20s on my disbelieve checks.
You better believe it.

Offline

#7 2008-12-30 20:24:32

tth
Member
Registered: 2006-05-21
Posts: 12

Re: I need LANG to be different from all the other locales, systemwide

Logout should be enough if you source /etc/profile in your ~/.bash_profile (which reads all /etc/profile.d/* files).

Offline

#8 2008-12-31 01:29:22

Mektub
Member
From: Lisbon /Portugal
Registered: 2008-01-02
Posts: 647

Re: I need LANG to be different from all the other locales, systemwide

and I really don't want to see all the abysmal german translations of all the apps. cool:cool:

I have the following in my ~/.bash_profile:

export LANG="en_US.UTF-8"
export SUPPORTED="en_US.UTF-8:en_US:en:pt_PT.UTF-8:pt_PT:pt"
export LC_COLLATE="C"
export LC_TIME="pt_PT.UTF-8"
export LC_ADDRESS="pt_PT.UTF-8"
export LC_NAME="pt_PT.UTF-8"
export LC_NUMERIC="en_US.UTF-8"
export LC_MEASUREMENT="pt_PT.UTF-8"
export LC_MESSAGES="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
export LC_TELEPHONE="pt_PT.UTF-8"
export LC_MONETARY="pt_PT.UTF-8"
export LC_PAPER="pt_PT.UTF-8"

Well, perhaps the "export" isn't necessary.
This gives me the best of both worlds.

Mektub

Last edited by Mektub (2008-12-31 01:30:26)


Follow me on twitter: https://twitter.com/johnbina

Offline

#9 2009-01-03 03:35:07

ss2
Member
Registered: 2007-10-05
Posts: 83

Re: I need LANG to be different from all the other locales, systemwide

You could just set LOCALE=en_US.utf8 and KEYMAP="de" in rc.conf to get that what you want.
I guess that should help.
Otherwise you could also export the LC_* exports as how Mektub suggests in his .bash_profile.

Last edited by ss2 (2009-01-03 03:36:25)

Offline

Board footer

Powered by FluxBB