Dmitry Goncharov wrote:

> On Fri, Jul 10, 2026 at 3:07 AM Frank Heckenbach
> <[email protected]> wrote:
> >
> > When setting the locale via LC_MESSAGES or LC_ALL etc., this affects
> > both make's own messages such as "Entering directory" and those from
> > commands run by it (here: "total" from ls), e.g.:
> ...
> > Is there a way to change only one of them?
> 
> [dgonchar@dgonchar-7cefc2 test]# cat makefile
> export LC_MESSAGES=de_DE
> test:; @ls -l
> [dgonchar@dgonchar-7cefc2 test]# make -C .
> make: Entering directory '/root/gmake/test'
> insgesamt 4
> -rw-r--r-- 1 dgonchar root 40 Jul 10 13:04 makefile
> make: Leaving directory '/root/gmake/test'
> [dgonchar@dgonchar-7cefc2 test]#

This would require changing every Makefile, but I think it can also
be done on the command line. Putting this in my make wrapper script
seems to work. Do you see any issues with it?

#!/bin/bash
LC_ALL_SAVED="$LC_ALL"
CTYPE="${LC_ALL:-${LC_CTYPE:-$LANG}}"
case "${CTYPE^^}" in
  *UTF-8*|*UTF8*) export LC_ALL=C.UTF-8;;
  *) export LC_ALL=C;;
esac
make LC_ALL="$LC_ALL_SAVED" ...

PS, Henrik Carlqvist suggested:

> In addition to Dmitrys excellent answer, if you do not want to modify the
> Makefile and still want to be able to choose language with LC_MESSAGES when
> running make... If you really want makes messages to _allways_ be in enghlish
> no matter what, then you can  remove all those make.mo files from your system.
> When no make.mo file is found in a directory matching your choosen locale make
> will fall back to english.

That should work, but it would be a rather radical solution, and not
nice on a multi-user system. Of course, I could install a local copy
of make configured with a different message path or entirely without
i18n, but I hope the above will do.

Regards,
Frank

Reply via email to