On Saturday, 11 December 2004, at 01:04:18 (-0800),
E CVS List wrote:

> Log Message:
> get locale for help from LANG instead of LC_ALL
> 
> ===================================================================
> RCS file: /cvsroot/enlightenment/e16/tools/e16menuedit2/src/file.c,v
> retrieving revision 1.11
> retrieving revision 1.12
> diff -u -3 -r1.11 -r1.12
> --- file.c    5 Dec 2004 13:19:48 -0000       1.11
> +++ file.c    11 Dec 2004 09:04:17 -0000      1.12
> @@ -378,10 +378,8 @@
>    gboolean help_missing = TRUE;
>    struct stat buf;
>  
> -  locale = setlocale (LC_MESSAGES, NULL);
> +  locale = getenv ("LANG");

This doesn't seem right to me.  setlocale(LC_ALL, "") is the correct,
portable way to set up locale information so that you can subsequently
use nl_langinfo() and friends.  $LANG is not the only env var that
comes into play with locale setup.

>From the locale(7) man page:

       If the second argument to setlocale() is empty string, "", for
       the default locale, it is determined using the following steps:

       1.     If there is a non-null environment variable LC_ALL, the
              value of LC_ALL is used.

       2.     If an environment variable with the same name as one of
              the categories above exists and is non-null, its value
              is used for that category. 

       3.     If  there  is a non-null environment variable LANG, the
              value of LANG is used.

Note that $LANG is *last*, not first.

Michael

-- 
Michael Jennings (a.k.a. KainX)  http://www.kainx.org/  <[EMAIL PROTECTED]>
n + 1, Inc., http://www.nplus1.net/       Author, Eterm (www.eterm.org)
-----------------------------------------------------------------------
 "I'd like to live just long enough to be there when they cut off your
  head and stick it on a pike as a warning to the next ten generations
  that some favors come with too high a price.  I want to look up into
  your lifeless eyes and wave....  Can you and your associates arrange
  that for me, Mr. Morden?"                 -- Vir Cotto, Babylon Five


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
enlightenment-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to