Subject: Re: [clisp-list] internationalization problem on clisp-2.27

From: Bruno Haible <[email-masked]>
Date: Mon Sep 10 06:34:07 2001

Bernard Urban writes:

>  > > $ rm -rf build
>  > > > $ ./configure --build build
>  > > > $ cd build
>  > > > $ ./.clisp -q -norc -L french -x '(/ 0)'
>  > 
>  > this does work for me with the current development sources.
>  > could you please try the CVS version?
>
>  I just gave it a try: same problem.

For me it works, since the 2001-08-05 patch to spvw_language.d. But
the code assumes that you have a fr_FR locale installed in
/usr/lib/locale/. Which is the case for me, but perhaps not for you?

> I spotted the problem to be in gettext/intl/dcigettext.c in 
> #define HAVE_LOCALE_NULL. It appears that setlocale (.., NULL) does
> not work as assumed in the case of glibc2, and always returns the C
> locale instead of the fr locale defined in spvw_language.d.

glibc doesn't have an "fr" locale any more, it only has "fr_FR".

The HAVE_LOCALE_NULL setting is correct; it only means whether the
return value of setlocale is in a reasonable format.

Bruno

---

From: Bernard Urban <[email-masked]>
Date: Mon Sep 24 10:13:02 2001

Bruno Haible <[email-masked]> writes:

> Sam wrote:
[...]
> > From: Bernard Urban <[email-masked]>
> > 
> > Good news from the front ! It works now on Linux (not tried Solaris so far
> > to confirm Raymond Toy message).
> > 
> > So undefining HAVE_LOCALE_NULL forces the code to use instead
> > getenv("LC_MESSAGES"), which works ok.
> 
> I have tried undefining HAVE_LOCALE_NULL in gettext yesterday, and the
> effect is that gettext becomes less reliable. It has the effect that
> when I set e.g.   LANGUAGE=fr LANG=fr_DE  (i.e. pointing to a
> nonexistent locale), I get the french translations, but in a wrong
> character encoding! Therefore it's really better if gettext relies on
> the locales being present.

But in my case (Debian system), the fr locale prexisted 
(in /usr/share/locale) for some GNU utilities, 
so it should have been found ?

> > A long term solution to the above HAVE_LOCALE_NULL problem is probably
> > to test the feature through autoconf.
> 
> You cannot test for missing locales through autoconf. On every system,
> some locales are missing.
> 

I mean testing if HAVE_LOCALE_NULL works as expected, its value is
currently based on the use of glibc2.

-- 

Bernard Urban

---

From: Bruno Haible <[email-masked]>
Date: Mon Sep 24 12:13:16 2001

> so it should have been found ?

The locale is in /usr/lib/locale, and in glibc-2.2 there is no "fr"
locale. (What kind of monetary information would it contain? French or
Swiss or Luxemburgish Franc?)

What you see in /usr/share/locale are the translation catalogs, where
a catalog named "fr" acts as fallback for all locales starting in
"fr_": "fr_FR", "fr_CH" etc.

Bruno