This is the mail archive of the
cygwin-developers
mailing list for the Cygwin project.
Re: The old $LANG-in-a-box trick (was Re: X11R7.5 and C.UTF-8)
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin-developers at cygwin dot com
- Date: Fri, 4 Dec 2009 11:32:38 +0100
- Subject: Re: The old $LANG-in-a-box trick (was Re: X11R7.5 and C.UTF-8)
- References: <416096c60910281507n4774534dode1d24ac47d5b0a2@mail.gmail.com> <4B1115EC.7010308@cornell.edu> <4B174C20.1040900@tlinx.org> <416096c60912022348i36504e14l726efc9fc9c360e6@mail.gmail.com> <20091203045401.L85368@mail101.his.com> <416096c60912030516r42f67c05yfaa3b64fcca68b43@mail.gmail.com> <20091203134837.GX8059@calimero.vinschen.de> <20091203184458.GZ8059@calimero.vinschen.de> <416096c60912031215j68fd4966h8d2325a49e0c0d3f@mail.gmail.com> <4B1846F1.50503@cornell.edu>
- Reply-to: cygwin-developers at cygwin dot com
On Dec 3 18:17, Ken Brown wrote:
> On 12/3/2009 3:15 PM, Andy Koppe wrote:
> >2009/12/3 Corinna Vinschen:
> >>In theory we could use it in /etc/profile.d/lang.{c}sh:
> >>
> >>/etc/profile.d/lang.sh:
> >>
> >> test -z "${LC_ALL:-${LC_CTYPE:-$LANG}}" && eval $(getlocale -U)
> >>
> >>/etc/profile.d/lang.csh:
> >>
> >> if ( $?LC_ALL == 0 && $?LC_CTYPE == 0 && $?LANG == 0 ) eval `getlocale -cU`
> >>
> >>If that's desired, I could easily create a getlocale package for the
> >>Base category.
> >
> >It's very tempting, but I'm not sure. A couple of issues to consider:
> >- The setting is too late for terminal and shell, but then again, do
> >any of them care about the language setting (rather than the charset)?
> >- It would change the UI language of localized apps. I'd guess most
> >users would welcome programs speaking their language, but some would
> >complain loudly and demand to know how to get back to English.
>
> You could put something like the following in the default .bashrc:
>
> # Set the language for locale-aware applications to US English...
> # export LANG=en_US.UTF-8
>
> # ...or to UK English
> # export LANG=en_GB.UTF-8
Indeed, that's the reason I suggested that getlocale should return the
default system locale, not the user default locale. So, even by using
getlocale, the user could overwrite the system choice by
eval `getlocale -uU`
in .bashrc. However, we should get out 1.7.1 first. We can always
change this afterwards.
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat