'LANG=' produces German output

Werner LEMBERG wl at gnu.org
Thu Feb 13 14:40:34 UTC 2020

[CCing Bruno Haible]

>> on my Lion box, calling
>>  LANG= bison ...
>> I suddenly get *German* output!  Ditto for other programs like
>> 'info', 'ggrep', etc., that come with '.po' files.  Is this normal?
>> Is this a new gettext feature?
> I would suppose that without a valid locale LANG or the LC_*
> variables, there would be some other default - that it's not
> randomly picking a locale.

You are correct.

> On a "normal" Unix/Linux system, I would expect "C" locale (or
> perhaps a system setting) to be that default.  But Macs are a bit
> odd; their native apps get some defaults from system preference
> settings.  What are your language and region settings there?

It's seems to be a new feature of gettext 0.21, which comes with
improved MacOS support.  In the NEWS file I read

  * Runtime behaviour:
    - The interpretation of the language preferences on macOS has been
      improved, especially in the case where a system locale does not
      exist for the combination of the selected primary language and
      the selected territory.

In my shell, `set` shows


(and `LANGUAGE` is not set).

Some test results:

   bison --help                    English output
   LANG= bison --help              German output
   LANGUAGE= bison --help          English output
   LANG=C bison --help             English output

On my GNU/Linux box that still uses gettext, I get the
following with the same `LANG` setting.

   bison --help                    English output
   LANG= bison --help              English output
   LANGUAGE= bison --help          English output
   LANG=C bison --help             English output

My MacOS Lion box *is* a German one, so it seems that gettext extracts
language information from some other places if neither `LANGUAGE` nor
`LANG` is unset or set to an empty value.

I'm not sure whether I like this feature.  At least on the command
line, I consider it surprising.


More information about the macports-users mailing list