The old $LANG-in-a-box trick (was Re: X11R7.5 and C.UTF-8)

Ken Brown kbrown@cornell.edu
Thu Dec 3 23:17:00 GMT 2009


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

Ken



More information about the Cygwin-developers mailing list