* [gentoo-user] Questions regarding the usage of multiple locales
@ 2010-06-22 1:14 Christopher Swift
2010-06-22 13:38 ` Mick
2010-06-25 18:05 ` Enrico Weigelt
0 siblings, 2 replies; 19+ messages in thread
From: Christopher Swift @ 2010-06-22 1:14 UTC (permalink / raw
To: gentoo-user
I've setup my Gentoo box to use en_GB as the default locale
in /etc/env.d/02locale with tips from the Gentoo Localisation Guide[0].
Is it at all possible to set a locale, i.e. cy_GB to be the primary LANG
parameter but if there is no .po for cy_GB or the .po is incomplete to
use en_GB as a backup instead of the default en_US? So for example if
gedit were fully translated into Welsh (cy_GB) I could use gedit in
Welsh but emerge not being translated into Welsh would resort to en_GB
instead of en_US?
Many thanks / Diolch yn fawr iawn,
Chris
[0] http://www.gentoo.org/doc/en/guide-localization.xml
--
Christopher Swift <christopher.swift@linux.com>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Questions regarding the usage of multiple locales
2010-06-22 1:14 [gentoo-user] Questions regarding the usage of multiple locales Christopher Swift
@ 2010-06-22 13:38 ` Mick
2010-06-22 16:14 ` Christopher Swift
2010-06-25 18:05 ` Enrico Weigelt
1 sibling, 1 reply; 19+ messages in thread
From: Mick @ 2010-06-22 13:38 UTC (permalink / raw
To: gentoo-user
On 22 June 2010 02:14, Christopher Swift <christopher.swift@linux.com> wrote:
> I've setup my Gentoo box to use en_GB as the default locale
> in /etc/env.d/02locale with tips from the Gentoo Localisation Guide[0].
> Is it at all possible to set a locale, i.e. cy_GB to be the primary LANG
> parameter but if there is no .po for cy_GB or the .po is incomplete to
> use en_GB as a backup instead of the default en_US? So for example if
> gedit were fully translated into Welsh (cy_GB) I could use gedit in
> Welsh but emerge not being translated into Welsh would resort to en_GB
> instead of en_US?
I'm also interested in this - although my question is probably simpler:
I would like to use en_GB but I do not undestand why running 'locale'
as a plain user shows:
$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.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="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8
why when running it as root:
# locale
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
I do not have set a /etc/env.d/02locale yet, so where is my plain user
locale being read from?
--
Regards,
Mick
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Questions regarding the usage of multiple locales
2010-06-22 13:38 ` Mick
@ 2010-06-22 16:14 ` Christopher Swift
2010-06-26 10:40 ` Mick
0 siblings, 1 reply; 19+ messages in thread
From: Christopher Swift @ 2010-06-22 16:14 UTC (permalink / raw
To: gentoo-user
Ar Maw, 2010-06-22 am 14:38 +0100, ysgrifennodd Mick:
> I'm also interested in this - although my question is probably simpler:
>
> I would like to use en_GB but I do not undestand why running 'locale'
> as a plain user shows:
>
> $ locale
> LANG=en_US.UTF-8
> LC_CTYPE="en_US.UTF-8"
> LC_NUMERIC="en_US.UTF-8"
> LC_TIME="en_US.UTF-8"
> LC_COLLATE="en_US.UTF-8"
> LC_MONETARY="en_US.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="en_US.UTF-8"
> LC_IDENTIFICATION="en_US.UTF-8"
> LC_ALL=en_US.UTF-8
>
> why when running it as root:
>
> # locale
> LANG=
> LC_CTYPE="POSIX"
> LC_NUMERIC="POSIX"
> LC_TIME="POSIX"
> LC_COLLATE="POSIX"
> LC_MONETARY="POSIX"
> LC_MESSAGES="POSIX"
> LC_PAPER="POSIX"
> LC_NAME="POSIX"
> LC_ADDRESS="POSIX"
> LC_TELEPHONE="POSIX"
> LC_MEASUREMENT="POSIX"
> LC_IDENTIFICATION="POSIX"
> LC_ALL=
>
>
> I do not have set a /etc/env.d/02locale yet, so where is my plain user
> locale being read from?
Your plain user locale is usually read from ~/.bashrc, this can be set
to en_GB by having the following lines:
export LANG="en_GB.UTF-8"
export LC_COLLATE="C"
This will only affect that user but if you want to define a locale globally you have to adjust the file in /etc/env.d/02locale to have the top two lines read this:
LANG="en_GB.UTF-8"
LC_COLLATE="C"
After you've done that do "env-update && source /etc/profile" for the global settings or just source ~/.bashrc for the user's settings.
Hope this helps
--
Cofion
Christopher Swift (ianto) - christopher dot swift at linux dot com
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Questions regarding the usage of multiple locales
2010-06-22 1:14 [gentoo-user] Questions regarding the usage of multiple locales Christopher Swift
2010-06-22 13:38 ` Mick
@ 2010-06-25 18:05 ` Enrico Weigelt
1 sibling, 0 replies; 19+ messages in thread
From: Enrico Weigelt @ 2010-06-25 18:05 UTC (permalink / raw
To: gentoo-user
* Christopher Swift <christopher.swift@linux.com> wrote:
> Is it at all possible to set a locale, i.e. cy_GB to be the primary LANG
> parameter but if there is no .po for cy_GB or the .po is incomplete to
> use en_GB as a backup instead of the default en_US?
gettext allows to specify fallback languages:
http://www.gnu.org/software/gettext/manual/gettext.html#The-LANGUAGE-variable
Actually, I dont know if this works for your situation.
Conceptionally, you want some kind of overlay. You could do this
by a little script, which compiles several locales to a "virtual"
one, eg. by creating symlinks or compiling to new .po files
using msmerge:
http://www.gnu.org/software/gettext/manual/gettext.html#Updating
BUT: these files would become dynamic data, which is not handled
(eg. automatic removed on uninstall) by portage.
cu
--
---------------------------------------------------------------------
Enrico Weigelt == metux IT service - http://www.metux.de/
---------------------------------------------------------------------
Please visit the OpenSource QM Taskforce:
http://wiki.metux.de/public/OpenSource_QM_Taskforce
Patches / Fixes for a lot dozens of packages in dozens of versions:
http://patches.metux.de/
---------------------------------------------------------------------
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Questions regarding the usage of multiple locales
2010-06-22 16:14 ` Christopher Swift
@ 2010-06-26 10:40 ` Mick
2010-06-26 10:49 ` Mick
0 siblings, 1 reply; 19+ messages in thread
From: Mick @ 2010-06-26 10:40 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: Text/Plain, Size: 1710 bytes --]
On Tuesday 22 June 2010 17:14:13 Christopher Swift wrote:
> Ar Maw, 2010-06-22 am 14:38 +0100, ysgrifennodd Mick:
> > I'm also interested in this - although my question is probably simpler:
> >
> > I would like to use en_GB but I do not undestand why running 'locale'
> > as a plain user shows:
> >
> > $ locale
> > LANG=en_US.UTF-8
> > LC_CTYPE="en_US.UTF-8"
> > LC_NUMERIC="en_US.UTF-8"
> > LC_TIME="en_US.UTF-8"
> > LC_COLLATE="en_US.UTF-8"
> > LC_MONETARY="en_US.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="en_US.UTF-8"
> > LC_IDENTIFICATION="en_US.UTF-8"
> > LC_ALL=en_US.UTF-8
> >
> > why when running it as root:
> >
> > # locale
> > LANG=
> > LC_CTYPE="POSIX"
> > LC_NUMERIC="POSIX"
> > LC_TIME="POSIX"
> > LC_COLLATE="POSIX"
> > LC_MONETARY="POSIX"
> > LC_MESSAGES="POSIX"
> > LC_PAPER="POSIX"
> > LC_NAME="POSIX"
> > LC_ADDRESS="POSIX"
> > LC_TELEPHONE="POSIX"
> > LC_MEASUREMENT="POSIX"
> > LC_IDENTIFICATION="POSIX"
> > LC_ALL=
> >
> >
> > I do not have set a /etc/env.d/02locale yet, so where is my plain user
> > locale being read from?
>
> Your plain user locale is usually read from ~/.bashrc, this can be set
> to en_GB by having the following lines:
> export LANG="en_GB.UTF-8"
> export LC_COLLATE="C"
I have not exported any locale in my ~/.bashrc, so should a plain user locale
reflect what's in /etc/env.d/02locale?
I added /etc/env.d/02locale as you show above, but my plain user still shows
all settings as "en_US.UTF-8" ... where is this US setting read from?
Thanks,
--
Regards,
Mick
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Questions regarding the usage of multiple locales
2010-06-26 10:40 ` Mick
@ 2010-06-26 10:49 ` Mick
2010-06-26 11:10 ` Alex Schuster
0 siblings, 1 reply; 19+ messages in thread
From: Mick @ 2010-06-26 10:49 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: Text/Plain, Size: 2066 bytes --]
On Saturday 26 June 2010 11:40:14 Mick wrote:
> On Tuesday 22 June 2010 17:14:13 Christopher Swift wrote:
> > Ar Maw, 2010-06-22 am 14:38 +0100, ysgrifennodd Mick:
> > > I'm also interested in this - although my question is probably simpler:
> > >
> > > I would like to use en_GB but I do not undestand why running 'locale'
> > > as a plain user shows:
> > >
> > > $ locale
> > > LANG=en_US.UTF-8
> > > LC_CTYPE="en_US.UTF-8"
> > > LC_NUMERIC="en_US.UTF-8"
> > > LC_TIME="en_US.UTF-8"
> > > LC_COLLATE="en_US.UTF-8"
> > > LC_MONETARY="en_US.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="en_US.UTF-8"
> > > LC_IDENTIFICATION="en_US.UTF-8"
> > > LC_ALL=en_US.UTF-8
> > >
> > > why when running it as root:
> > >
> > > # locale
> > > LANG=
> > > LC_CTYPE="POSIX"
> > > LC_NUMERIC="POSIX"
> > > LC_TIME="POSIX"
> > > LC_COLLATE="POSIX"
> > > LC_MONETARY="POSIX"
> > > LC_MESSAGES="POSIX"
> > > LC_PAPER="POSIX"
> > > LC_NAME="POSIX"
> > > LC_ADDRESS="POSIX"
> > > LC_TELEPHONE="POSIX"
> > > LC_MEASUREMENT="POSIX"
> > > LC_IDENTIFICATION="POSIX"
> > > LC_ALL=
> > >
> > >
> > > I do not have set a /etc/env.d/02locale yet, so where is my plain user
> > > locale being read from?
> >
> > Your plain user locale is usually read from ~/.bashrc, this can be set
> > to en_GB by having the following lines:
> > export LANG="en_GB.UTF-8"
> > export LC_COLLATE="C"
>
> I have not exported any locale in my ~/.bashrc, so should a plain user
> locale reflect what's in /etc/env.d/02locale?
>
> I added /etc/env.d/02locale as you show above, but my plain user still
> shows all settings as "en_US.UTF-8" ... where is this US setting read
> from?
Oops! This is more complicated that I thought ...
If, always as a plain user, I use aterm then /etc/env.d/02locale is read and
LANG is en_GB.UTF-8. However, if I use xterm it is still LANG=en_US.UTF-8
--
Regards,
Mick
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Questions regarding the usage of multiple locales
2010-06-26 10:49 ` Mick
@ 2010-06-26 11:10 ` Alex Schuster
2010-06-26 11:29 ` Mick
0 siblings, 1 reply; 19+ messages in thread
From: Alex Schuster @ 2010-06-26 11:10 UTC (permalink / raw
To: gentoo-user
Mick writes:
> On Saturday 26 June 2010 11:40:14 Mick wrote:
> > I have not exported any locale in my ~/.bashrc, so should a plain
> > user locale reflect what's in /etc/env.d/02locale?
> >
> > I added /etc/env.d/02locale as you show above, but my plain user
> > still shows all settings as "en_US.UTF-8" ... where is this US
> > setting read from?
>
> Oops! This is more complicated that I thought ...
>
> If, always as a plain user, I use aterm then /etc/env.d/02locale is
> read and LANG is en_GB.UTF-8. However, if I use xterm it is still
> LANG=en_US.UTF-8
Your aterm is configured as a login shell, and as such reads /etc/profile,
which reads /etc/profile.env (and ~/.[bash]profile). xterm is not a login
shell, and reads /etc/bash/bashrc (and ~/.bashrc). You can call xterm with
the -ls option to make it alogin shell. For konsole, I have set it to
execute bash -l to make it a login shell.
Another workaround might be to read /etc/profile.env in your .bashrc, or
in /etc/bash/bashrc.
Wonko
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Questions regarding the usage of multiple locales
2010-06-26 11:10 ` Alex Schuster
@ 2010-06-26 11:29 ` Mick
2010-06-26 11:59 ` Alex Schuster
2010-06-26 12:54 ` Joerg Schilling
0 siblings, 2 replies; 19+ messages in thread
From: Mick @ 2010-06-26 11:29 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: Text/Plain, Size: 2255 bytes --]
On Saturday 26 June 2010 12:10:02 Alex Schuster wrote:
> Mick writes:
> > Oops! This is more complicated that I thought ...
> >
> > If, always as a plain user, I use aterm then /etc/env.d/02locale is
> > read and LANG is en_GB.UTF-8. However, if I use xterm it is still
> > LANG=en_US.UTF-8
>
> Your aterm is configured as a login shell, and as such reads /etc/profile,
> which reads /etc/profile.env (and ~/.[bash]profile). xterm is not a login
> shell, and reads /etc/bash/bashrc (and ~/.bashrc). You can call xterm with
> the -ls option to make it alogin shell. For konsole, I have set it to
> execute bash -l to make it a login shell.
>
> Another workaround might be to read /etc/profile.env in your .bashrc, or
> in /etc/bash/bashrc.
Hmm... I've added all this in my /etc/env.d/02locale:
LANG="en_GB.UTF-8"
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="C"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
and in my ~/.bashrc
export LANG="en_GB.UTF-8"
export LC_CTYPE="en_GB.UTF-8"
export LC_NUMERIC="en_GB.UTF-8"
export LC_TIME="en_GB.UTF-8"
export LC_COLLATE="C"
export LC_MONETARY="en_GB.UTF-8"
export LC_MESSAGES="en_GB.UTF-8"
export LC_PAPER="en_GB.UTF-8"
export LC_NAME="en_GB.UTF-8"
export LC_ADDRESS="en_GB.UTF-8"
export LC_TELEPHONE="en_GB.UTF-8"
export LC_MEASUREMENT="en_GB.UTF-8"
export LC_IDENTIFICATION="en_GB.UTF-8"
but this is what aterm is showing:
$ locale
LANG=en_GB.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.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="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8
There's no mention of LANG or LC_*US* in /etc/profile.env, /etc/bash/bashrc,
or anywhere else that I can see. So, where is it being read from?
PS. Not sure why LANG=en_GB.UTF-8 does not have " " marks like the LC_
parameters?
--
Regards,
Mick
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Questions regarding the usage of multiple locales
2010-06-26 11:29 ` Mick
@ 2010-06-26 11:59 ` Alex Schuster
2010-06-26 12:20 ` William Kenworthy
2010-06-26 12:54 ` Joerg Schilling
1 sibling, 1 reply; 19+ messages in thread
From: Alex Schuster @ 2010-06-26 11:59 UTC (permalink / raw
To: gentoo-user
Mick writes:
> On Saturday 26 June 2010 12:10:02 Alex Schuster wrote:
> > Your aterm is configured as a login shell, and as such reads
At least I thought so, what else could be the cause. But I just emerged
aterm, and the default is also to be not a login shell. There is a -ls
option for this, or the loginShell resource. Same as for xterm. So, there
should be no difference in those two shells. Maybe you started them with a
desktop shortcut that has extra options in it?
When debugging such things, I modify the startup files and add statements
like '[[ $- == *i* ]] echo .bashrc', so I see which ones get read. The [[
]] stuff makes this happen in interactive shells, so scripts are not
confused by the text output.
When starting one terminal from inside another, environment variables will
be
> > /etc/profile, which reads /etc/profile.env (and ~/.[bash]profile).
> > xterm is not a login shell, and reads /etc/bash/bashrc (and
> > ~/.bashrc). You can call xterm with the -ls option to make it
> > alogin shell. For konsole, I have set it to execute bash -l to make
> > it a login shell.
> >
> > Another workaround might be to read /etc/profile.env in your .bashrc,
> > or in /etc/bash/bashrc.
>
> Hmm... I've added all this in my /etc/env.d/02locale:
>
> LANG="en_GB.UTF-8"
> LC_CTYPE="en_GB.UTF-8"
[...]
>
> and in my ~/.bashrc
>
> export LANG="en_GB.UTF-8"
> export LC_CTYPE="en_GB.UTF-8"
[...]
>
> but this is what aterm is showing:
>
> $ locale
> LANG=en_GB.UTF-8
> LC_CTYPE="en_US.UTF-8"
[...]
> LC_ALL=en_US.UTF-8
Still looks like login shell behaviour, or else ~/.bashrc should have been
read.
> There's no mention of LANG or LC_*US* in /etc/profile.env,
Did you run env-update.sh? This puts all the stuff in /etc/env.d/ into
/ect/profile.env.
> /etc/bash/bashrc, or anywhere else that I can see. So, where is it
> being read from?
Hmm. Does grep -r LC_ALL /etc find something?
> PS. Not sure why LANG=en_GB.UTF-8 does not have " " marks like the LC_
> parameters?
Seems to be normal behaviour of the locale command.
Sorry, I don't know what's going on there.
Wonko
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Questions regarding the usage of multiple locales
2010-06-26 11:59 ` Alex Schuster
@ 2010-06-26 12:20 ` William Kenworthy
2010-06-26 12:38 ` Mick
0 siblings, 1 reply; 19+ messages in thread
From: William Kenworthy @ 2010-06-26 12:20 UTC (permalink / raw
To: gentoo-user
On Sat, 2010-06-26 at 13:59 +0200, Alex Schuster wrote:
> Mick writes:
>
> > On Saturday 26 June 2010 12:10:02 Alex Schuster wrote:
>
> > > Your aterm is configured as a login shell, and as such reads
>
You might want to read this and set up your locales properly.
http://www.gentoo.org/doc/en/guide-localization.xml
BillK
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Questions regarding the usage of multiple locales
2010-06-26 12:20 ` William Kenworthy
@ 2010-06-26 12:38 ` Mick
2010-06-26 12:43 ` William Kenworthy
2010-06-26 13:41 ` Christopher Swift
0 siblings, 2 replies; 19+ messages in thread
From: Mick @ 2010-06-26 12:38 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: Text/Plain, Size: 815 bytes --]
On Saturday 26 June 2010 13:20:38 William Kenworthy wrote:
> On Sat, 2010-06-26 at 13:59 +0200, Alex Schuster wrote:
> > Mick writes:
> > > On Saturday 26 June 2010 12:10:02 Alex Schuster wrote:
> > > > Your aterm is configured as a login shell, and as such reads
>
> You might want to read this and set up your locales properly.
>
> http://www.gentoo.org/doc/en/guide-localization.xml
Thanks Bill, that's where I started, but I am getting confused with the way my
system and various terminals respond to the suggested files/settings.
The only way to see the locales I entered in /etc/env.d/02locale is by
launching a terminal (aterm, xterm, urxvt) and 'su -' to root. In all other
cases US locales seem to take over (although the LANG setting appears to be
working).
--
Regards,
Mick
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Questions regarding the usage of multiple locales
2010-06-26 12:38 ` Mick
@ 2010-06-26 12:43 ` William Kenworthy
2010-06-26 13:54 ` Mick
2010-06-26 13:41 ` Christopher Swift
1 sibling, 1 reply; 19+ messages in thread
From: William Kenworthy @ 2010-06-26 12:43 UTC (permalink / raw
To: gentoo-user
On Sat, 2010-06-26 at 13:38 +0100, Mick wrote:
> On Saturday 26 June 2010 13:20:38 William Kenworthy wrote:
> > On Sat, 2010-06-26 at 13:59 +0200, Alex Schuster wrote:
> > > Mick writes:
> > > > On Saturday 26 June 2010 12:10:02 Alex Schuster wrote:
> > > > > Your aterm is configured as a login shell, and as such reads
> >
> > You might want to read this and set up your locales properly.
> >
> > http://www.gentoo.org/doc/en/guide-localization.xml
>
> Thanks Bill, that's where I started, but I am getting confused with the way my
> system and various terminals respond to the suggested files/settings.
>
> The only way to see the locales I entered in /etc/env.d/02locale is by
> launching a terminal (aterm, xterm, urxvt) and 'su -' to root. In all other
> cases US locales seem to take over (although the LANG setting appears to be
> working).
Could it be your desktop overiding the basics? - gnome or kde perhaps?
Also check the login manager (I use GDM and there is a language setting
for the login there.)
BillK
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Questions regarding the usage of multiple locales
2010-06-26 11:29 ` Mick
2010-06-26 11:59 ` Alex Schuster
@ 2010-06-26 12:54 ` Joerg Schilling
1 sibling, 0 replies; 19+ messages in thread
From: Joerg Schilling @ 2010-06-26 12:54 UTC (permalink / raw
To: gentoo-user
Mick <michaelkintzios@gmail.com> wrote:
> Hmm... I've added all this in my /etc/env.d/02locale:
>
> LANG="en_GB.UTF-8"
> LC_CTYPE="en_GB.UTF-8"
> LC_NUMERIC="en_GB.UTF-8"
> LC_TIME="en_GB.UTF-8"
> LC_COLLATE="C"
> LC_MONETARY="en_GB.UTF-8"
> LC_MESSAGES="en_GB.UTF-8"
> LC_PAPER="en_GB.UTF-8"
> LC_NAME="en_GB.UTF-8"
> LC_ADDRESS="en_GB.UTF-8"
> LC_TELEPHONE="en_GB.UTF-8"
> LC_MEASUREMENT="en_GB.UTF-8"
> LC_IDENTIFICATION="en_GB.UTF-8"
Note that LANG is only for historic reasons, it was used by SunOS-4.x (23 years
ago) when the LC_* Variables have not yet been defined.
Jörg
--
EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
js@cs.tu-berlin.de (uni)
joerg.schilling@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/
URL: http://cdrecord.berlios.de/private/ ftp://ftp.berlios.de/pub/schily
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Questions regarding the usage of multiple locales
2010-06-26 12:38 ` Mick
2010-06-26 12:43 ` William Kenworthy
@ 2010-06-26 13:41 ` Christopher Swift
1 sibling, 0 replies; 19+ messages in thread
From: Christopher Swift @ 2010-06-26 13:41 UTC (permalink / raw
To: gentoo-user
On Sat, 2010-06-26 at 13:38 +0100, Mick wrote:
> On Saturday 26 June 2010 13:20:38 William Kenworthy wrote:
> > On Sat, 2010-06-26 at 13:59 +0200, Alex Schuster wrote:
> > > Mick writes:
> > > > On Saturday 26 June 2010 12:10:02 Alex Schuster wrote:
> > > > > Your aterm is configured as a login shell, and as such reads
> >
> > You might want to read this and set up your locales properly.
> >
> > http://www.gentoo.org/doc/en/guide-localization.xml
>
> Thanks Bill, that's where I started, but I am getting confused with the way my
> system and various terminals respond to the suggested files/settings.
>
> The only way to see the locales I entered in /etc/env.d/02locale is by
> launching a terminal (aterm, xterm, urxvt) and 'su -' to root. In all other
> cases US locales seem to take over (although the LANG setting appears to be
> working).
In my /etc/env.d/02locale file, it reads as the following:
LANG="en_GB.UTF-8"
LC_COLLATE="C"
When running "locale" as either root or any other user I get:
chris@ianto-gentoo-amd ~ $ locale
LANG=en_GB.UTF-8
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE=C
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=
If you want en_GB I recommend that you change it to what I've got in my
02locale file and then run the following command as root:
$ env-update && source /etc/profile
This is what I've used to globally set en_GB as the default language.
Hope this helps,
Chris.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Questions regarding the usage of multiple locales
2010-06-26 12:43 ` William Kenworthy
@ 2010-06-26 13:54 ` Mick
0 siblings, 0 replies; 19+ messages in thread
From: Mick @ 2010-06-26 13:54 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: Text/Plain, Size: 824 bytes --]
On Saturday 26 June 2010 13:43:54 William Kenworthy wrote:
> Could it be your desktop overiding the basics? - gnome or kde perhaps?
> Also check the login manager (I use GDM and there is a language setting
> for the login there.)
Aha! You got it! From a console both ~/.bashrc and /etc/env.d/02locale are
being read as expected and the settings adopted.
From within X the different terminals do their own thing. So it must be a
dekstop script that sets them up differently. The question then becomes,
which script ...
I use Enlightenment as my desktop manager and kdm as the Display Manager, but
wouldn't know where to look further than that. kdm is starting up
Enlightenment by reading my ~/.xsession, which does not have any locale
settings in it from what I can tell.
--
Regards,
Mick
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Questions regarding the usage of multiple locales
[not found] ` <eZBTP-3dF-1@gated-at.bofh.it>
@ 2010-06-26 15:27 ` David W Noon
2010-06-26 15:40 ` Dale
0 siblings, 1 reply; 19+ messages in thread
From: David W Noon @ 2010-06-26 15:27 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1902 bytes --]
On Sat, 26 Jun 2010 13:40:01 +0200, Mick wrote about Re: [gentoo-user]
Questions regarding the usage of multiple locales:
[snip]
>Hmm... I've added all this in my /etc/env.d/02locale:
>
>LANG="en_GB.UTF-8"
>LC_CTYPE="en_GB.UTF-8"
>LC_NUMERIC="en_GB.UTF-8"
>LC_TIME="en_GB.UTF-8"
>LC_COLLATE="C"
>LC_MONETARY="en_GB.UTF-8"
>LC_MESSAGES="en_GB.UTF-8"
>LC_PAPER="en_GB.UTF-8"
>LC_NAME="en_GB.UTF-8"
>LC_ADDRESS="en_GB.UTF-8"
>LC_TELEPHONE="en_GB.UTF-8"
>LC_MEASUREMENT="en_GB.UTF-8"
>LC_IDENTIFICATION="en_GB.UTF-8"
Did you run env-update afterwards?
I ditched all those /etc/env.d settings for locale, and put mine
in /etc/profile.d/local.sh as follows:
<---------><---------><---------><---------><---------><--------->
# Temporary files go to the RAMDisk.
export TMPDIR='/tmp'
# Define our local squid proxy.
export http_proxy='http://localhost:8080'
export ftp_proxy='http://localhost:8080'
export RSYNC_PROXY='localhost:8080'
# The OpenSSL random seed lives here:
export RANDFILE='/.rnd'
# Set the zsh FTP commands to use passive mode
export ZFTP_PREFS='P'
# If the user has a private bin directory, prepend it to the PATH.
if [ -d "$HOME/bin" ]; then
export PATH="$HOME/bin:$PATH"
fi
# Set a sensible locale, if possible.
if [ -d '/usr/share/locale/en_GB' ]; then
export LC_ALL='en_GB.utf8'
export LANG='en_GB.utf8'
export LANGUAGE='en_GB.utf8'
else
export LC_ALL='C'
unset LANG LANGUAGE
fi
<---------><---------><---------><---------><---------><--------->
This gives me a single point of maintenance for several system
customizations. Also, it allows me to use conditional logic to set
sensible values.
--
Regards,
Dave [RLU #314465]
======================================================================
dwnoon@ntlworld.com (David W Noon)
======================================================================
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Questions regarding the usage of multiple locales
2010-06-26 15:27 ` David W Noon
@ 2010-06-26 15:40 ` Dale
2010-06-26 17:17 ` Mick
0 siblings, 1 reply; 19+ messages in thread
From: Dale @ 2010-06-26 15:40 UTC (permalink / raw
To: gentoo-user
David W Noon wrote:
> On Sat, 26 Jun 2010 13:40:01 +0200, Mick wrote about Re: [gentoo-user]
> Questions regarding the usage of multiple locales:
>
> [snip]
>
>> Hmm... I've added all this in my /etc/env.d/02locale:
>>
>> LANG="en_GB.UTF-8"
>> LC_CTYPE="en_GB.UTF-8"
>> LC_NUMERIC="en_GB.UTF-8"
>> LC_TIME="en_GB.UTF-8"
>> LC_COLLATE="C"
>> LC_MONETARY="en_GB.UTF-8"
>> LC_MESSAGES="en_GB.UTF-8"
>> LC_PAPER="en_GB.UTF-8"
>> LC_NAME="en_GB.UTF-8"
>> LC_ADDRESS="en_GB.UTF-8"
>> LC_TELEPHONE="en_GB.UTF-8"
>> LC_MEASUREMENT="en_GB.UTF-8"
>> LC_IDENTIFICATION="en_GB.UTF-8"
>>
> Did you run env-update afterwards?
>
> I ditched all those /etc/env.d settings for locale, and put mine
> in /etc/profile.d/local.sh as follows:
>
<< SNIP >>
Something I run into sometimes, if you are using KDE, log out then log
back in. I run into this pretty regular and usually forget. I have
been sort of half reading this thread and seem to recall reading you are
using KDE. I know this applies to when you change the groups a user is
in. Ran into that the other day. This may apply to other desktops as
well. I only have KDE here. Just thought I would mention just in case.
Dale
:-) :-)
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Questions regarding the usage of multiple locales
2010-06-26 15:40 ` Dale
@ 2010-06-26 17:17 ` Mick
0 siblings, 0 replies; 19+ messages in thread
From: Mick @ 2010-06-26 17:17 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: Text/Plain, Size: 4581 bytes --]
On Saturday 26 June 2010 16:40:53 Dale wrote:
> David W Noon wrote:
> > On Sat, 26 Jun 2010 13:40:01 +0200, Mick wrote about Re: [gentoo-user]
> > Questions regarding the usage of multiple locales:
> >
> > [snip]
> >
> >> Hmm... I've added all this in my /etc/env.d/02locale:
> >>
> >> LANG="en_GB.UTF-8"
> >> LC_CTYPE="en_GB.UTF-8"
> >> LC_NUMERIC="en_GB.UTF-8"
> >> LC_TIME="en_GB.UTF-8"
> >> LC_COLLATE="C"
> >> LC_MONETARY="en_GB.UTF-8"
> >> LC_MESSAGES="en_GB.UTF-8"
> >> LC_PAPER="en_GB.UTF-8"
> >> LC_NAME="en_GB.UTF-8"
> >> LC_ADDRESS="en_GB.UTF-8"
> >> LC_TELEPHONE="en_GB.UTF-8"
> >> LC_MEASUREMENT="en_GB.UTF-8"
> >> LC_IDENTIFICATION="en_GB.UTF-8"
> >
> > Did you run env-update afterwards?
> >
> > I ditched all those /etc/env.d settings for locale, and put mine
>
> > in /etc/profile.d/local.sh as follows:
> << SNIP >>
>
> Something I run into sometimes, if you are using KDE, log out then log
> back in. I run into this pretty regular and usually forget. I have
> been sort of half reading this thread and seem to recall reading you are
> using KDE. I know this applies to when you change the groups a user is
> in. Ran into that the other day. This may apply to other desktops as
> well. I only have KDE here. Just thought I would mention just in case.
Thank you all for your suggestions.
First of all I'd like to apologise to Christopher because I did not intend to
hi-jack his thread (I was hoping I had something basic wrong and was looking
for a quick fix).
I have run 'env-update && source /etc/profile' after making any change. I
have also rebooted for good measure since this thread spanned more than a few
days so far.
I do not use the full KDE. Instead I use Enlightenment with some KDE
applications. I do use kdm to login.
The consoles work as expected, but terminals in X do not. They seem to be
stuck to (or overwritten by) a US profile for some reason.
Running env-update works as far as updating the /etc/profile.env file goes:
========================================
# THIS FILE IS AUTOMATICALLY GENERATED BY env-update.
# DO NOT EDIT THIS FILE. CHANGES TO STARTUP PROFILES
# GO INTO /etc/profile NOT /etc/profile.env
export CONFIG_PROTECT='/usr/share/X11/xkb /usr/share/config'
export CONFIG_PROTECT_MASK='/etc/sandbox.d /etc/fonts/fonts.conf /etc/gconf
/etc/terminfo /etc/ca-certificates.conf /etc/revdep-rebuild'
export CVS_RSH='ssh'
export GCC_SPECS=''
export GDK_USE_XFT='1'
export ICAROOT='/opt/ICAClient'
export INFOPATH='/usr/share/info:/usr/share/binutils-data/x86_64-pc-linux-
gnu/2.20.1/info:/usr/share/gcc-data/x86_64-pc-linux-gnu/4.4.3/info'
export LANG='en_GB.UTF-8'
export LC_ADDRESS='en_GB.UTF-8'
export LC_COLLATE='C'
export LC_CTYPE='en_GB.UTF-8'
export LC_IDENTIFICATION='en_GB.UTF-8'
export LC_MEASUREMENT='en_GB.UTF-8'
export LC_MESSAGES='en_GB.UTF-8'
export LC_MONETARY='en_GB.UTF-8'
export LC_NAME='en_GB.UTF-8'
export LC_NUMERIC='en_GB.UTF-8'
export LC_PAPER='en_GB.UTF-8'
export LC_TELEPHONE='en_GB.UTF-8'
export LC_TIME='en_GB.UTF-8'
[snip ...]
========================================
Out of all the above only LANG takes and is shown as LANG=en_GB.UTF-8, all the
rest are shown as ="en_US.UTF-8" in xterm, aterm, urxvt, konsole.
Launching xterm from an aterm with -ls or with -lc does not change the output
- i.e. xterm does not read .bashrc or /etc/env.d/02locale.
So I conluded after Bill kindly hinted, that either kdm or E17 do something
different than what I expect with locales, because terminals running in X do
not recognise my settings.
Looking into KDE systemsettings I see this under Country Selector: "Not set
(Generic English)". Also, language is blank - despite the fact that I have
set up LINGUAS="en_GB". Setting Country as UK and rebooting did not make any
difference with regards to locales, or language (which is still shown blank
with English US as the only drop down option).
Then I looked into Enlightenment's 'Settings Panel'/Language and noticed that
although it had picked up language as English/UK it had not picked up the
UTF-8 character set. Selected that, logged out/in and now all my locale
settings in terminals show en_GB.UTF-8 (even for LC_COLLATE and LC_ALL).
Therefore, it was the desktop manager after all!
Thank you very much for your help.
PS. Going back to the original thread and the link that Enrico gave, are we
meant to set up LANGUAGE separately to LANG? (I thought they were the same).
--
Regards,
Mick
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Questions regarding the usage of multiple locales
[not found] ` <eZFNL-m1-7@gated-at.bofh.it>
@ 2010-06-26 17:37 ` David W Noon
0 siblings, 0 replies; 19+ messages in thread
From: David W Noon @ 2010-06-26 17:37 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1401 bytes --]
On Sat, 26 Jun 2010 17:50:01 +0200, Dale wrote about Re: [gentoo-user]
Questions regarding the usage of multiple locales:
>David W Noon wrote:
[snip]
>> I ditched all those /etc/env.d settings for locale, and put mine
>> in /etc/profile.d/local.sh as follows:
>>
><< SNIP >>
>
>Something I run into sometimes, if you are using KDE, log out then log
>back in. I run into this pretty regular and usually forget. I have
>been sort of half reading this thread and seem to recall reading you
>are using KDE. I know this applies to when you change the groups a
>user is in. Ran into that the other day. This may apply to other
>desktops as well. I only have KDE here. Just thought I would mention
>just in case.
It applies to all desktop environments. Whenever you change your
central environment variables you must logout and login again, so that
the revisions to /etc/profile and all its associated scripts are
re-elaborated.
In a console shell, you can usually do:
. /etc/profile
and the new environment values will be assigned. This is why we are
told to do that when we use eselect to switch slots of some slotted
package, such as GCC.
--
Regards,
Dave [RLU #314465]
======================================================================
dwnoon@ntlworld.com (David W Noon)
======================================================================
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2010-06-26 17:38 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-22 1:14 [gentoo-user] Questions regarding the usage of multiple locales Christopher Swift
2010-06-22 13:38 ` Mick
2010-06-22 16:14 ` Christopher Swift
2010-06-26 10:40 ` Mick
2010-06-26 10:49 ` Mick
2010-06-26 11:10 ` Alex Schuster
2010-06-26 11:29 ` Mick
2010-06-26 11:59 ` Alex Schuster
2010-06-26 12:20 ` William Kenworthy
2010-06-26 12:38 ` Mick
2010-06-26 12:43 ` William Kenworthy
2010-06-26 13:54 ` Mick
2010-06-26 13:41 ` Christopher Swift
2010-06-26 12:54 ` Joerg Schilling
2010-06-25 18:05 ` Enrico Weigelt
[not found] <eY0jD-8ts-9@gated-at.bofh.it>
[not found] ` <eZBh8-2es-7@gated-at.bofh.it>
[not found] ` <eZBAu-2R1-5@gated-at.bofh.it>
[not found] ` <eZBTP-3dF-1@gated-at.bofh.it>
2010-06-26 15:27 ` David W Noon
2010-06-26 15:40 ` Dale
2010-06-26 17:17 ` Mick
[not found] <eZFup-8qx-3@gated-at.bofh.it>
[not found] ` <eZFup-8qx-5@gated-at.bofh.it>
[not found] ` <eZFup-8qx-7@gated-at.bofh.it>
[not found] ` <eZFup-8qx-9@gated-at.bofh.it>
[not found] ` <eZFup-8qx-1@gated-at.bofh.it>
[not found] ` <eZFNL-m1-7@gated-at.bofh.it>
2010-06-26 17:37 ` David W Noon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox