Il 14/01/22 12:26, Laurent Rineau ha scritto:
On Thursday, January 13, 2022 5:09:10 PM CET Mattia Verga wrote:
> By comparing the `printenv` output in linux terminal and in konsole I
> see that both have `LANG=it_IT.UTF-8` (which is correct), but konsole
> adds `LANGUAGE=it:en_US` which seems a strange value.
LANGUAGE is a variable that can specify a list of prefered languages, with `:` as the
separator. See the documentation here in the manual of gettext:
https://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variab...
> I now have to find out what KDE setting is injecting the LANGUAGE
> variable... there's nothing in bashrc or bash_profile, so it may be some
> KDE setting.
In KDE System Settings, section "Regional Settings/Language", you probably have
specified that you prefer "italiano" and then "American English". That
is wky konsole sets that variable.
> Unset the LANGUAGE variable make the script run fine.
As documented, LANGUAGE has a precedence over LANG or LC_* variables. See also:
https://www.gnu.org/software/gettext/manual/html_node/Locale-Environment-...
By unsetting it, you let the code fallback to the other variables.
Searching online I had read that setting LC_ALL=C should have overridden
LANGUAGE also... and, indeed, after having played with Konsole language
settings and env variables it does. I'm not sure why my previous
attempts were unsuccessful.
Anyway, problem solved, thanks all for the input.
Mattia