On Mon, Apr 14, 2025 at 10:44:06 -0400, Chet Ramey wrote: > According to > https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap08.html#tag_08_02 > > only gettext(3) looks at LANGUAGE, and that behavior can't be modified by > any calls to setlocale(3). gettext(3) is responsible for overriding > the `active category', which is LC_MESSAGES, according to what it finds > in $LANGUAGE. > > If there is no installed locale for en_US, or no LC_MESSAGES bash.mo file > in the right place, gettext(3) will ignore that locale in $LANGUAGE. > > So whether or not bash does anything with LANGUAGE -- it does not -- and > whether or not gettext(3) does the right thing with LANGUAGE -- it probably > does -- you see the translated version and copyright strings in the locale > that gettext(3) thinks you should.
hobbit:~$ locate bash.mo [...] /usr/share/locale/de/LC_MESSAGES/bash.mo /usr/share/locale/el/LC_MESSAGES/bash.mo /usr/share/locale/en@boldquot/LC_MESSAGES/bash.mo /usr/share/locale/en@quot/LC_MESSAGES/bash.mo /usr/share/locale/eo/LC_MESSAGES/bash.mo /usr/share/locale/es/LC_MESSAGES/bash.mo [...] So... is this how it's actually supposed to work? =============================================== hobbit:~$ LANGUAGE=en:en_US:es bash --version GNU bash, versión 5.2.15(1)-release (x86_64-pc-linux-gnu) Copyright (C) 2022 Free Software Foundation, Inc. Licencia GPLv3+: GPL de GNU versión 3 o posterior <http://gnu.org/licenses/gpl.html> Esto es software libre, es libre para modificar y redistribuirlo. No hay NINGUNA GARANTÍA, a la extensión permitida por la ley. =============================================== hobbit:~$ LANGUAGE=en@quot:es bash --version GNU bash, version 5.2.15(1)-release (x86_64-pc-linux-gnu) Copyright (C) 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. =============================================== Are bilingual but primarily-English-speaking end users expected to put "en@quot" as their preferred language in the LANGUAGE variable, in order to get messages in English? Would creating an empty /usr/share/locale/en/LC_MESSAGES/bash.mo file make it work as expected? (Tested: no, it does not.)