0

I am using Kubuntu 18.04. I had some trouble with my keyboard layouts which were solved but left some issues behind as a result. More specifically I have some language remnants is some aspects of my system. For example in Konsole I get all messages in Greek. I would like to get them in English. For example this message says (in Greek):

command not found

enter image description here

I tried changing the language but the methods I used did not seem to make a difference.

I tried:

export LANG=C

both on Konsole itself as well as in ~/.bashrc file which as far as I know changes to the default language which should be US English (good enough for me). For some reason my Konsole considers Greek to be my default language.

I tried explicitly setting:

export LANG=en_US.UTF-8

which also did not change much! Messages are in Greek.

Changing LC_ALL is the only one that seems to make a difference (although not a desired one):

export LC_ALL=C
$ fdsfdfd

fdsfdfd: \u03b7 \u03b5\u03bd\u03c4\u03bf\u03bb\u03ae \u03b4\u03b5 \u03b2\u03c1\u03ad\u03b8\u03b7\u03ba\u03b5

this returns the messages in Unicode(?).

Some interesting facts are

  1. previously they were in Spanish (I had added Spanish as 3rd language before)
  2. The console in other tty are correctly displaying the messages in English.

I have checked similar question like here or here which did not work for me (as mentioned before).

Any idea how can I resolve this issue?

Edit:
As @danzel asked the output of locale is:

$locale
LANG=C
LANGUAGE=en_US:es:el
LC_CTYPE="C"
LC_NUMERIC=el_GR.UTF-8
LC_TIME=el_GR.UTF-8
LC_COLLATE="C"
LC_MONETARY=el_GR.UTF-8
LC_MESSAGES="C"
LC_PAPER=el_GR.UTF-8
LC_NAME=el_GR.UTF-8
LC_ADDRESS=el_GR.UTF-8
LC_TELEPHONE=el_GR.UTF-8
LC_MEASUREMENT=el_GR.UTF-8
LC_IDENTIFICATION=el_GR.UTF-8
LC_ALL=

Also as @Gunnar Hjalmarsson suggested changing both $LANG and $LANGUAGE do seem to finally solve the problem although as this GNU documentation suggest it's probably enough to just change LANGUAGE which take precedence in message printing.

Eypros
  • 521

1 Answers1

1

Well, the answer to my problem was a close call. As it is mentioned in GNU documentation there are 3 environmental variables related to this issue:

  • LANG
  • LANGUAGE
  • LC_ALL

Of the 3 the last one normally shouldn't be set. Documentation states that:

GNU gettext gives preference to LANGUAGE over LC_ALL and LANG for the purpose of message handling, but you still need to have LANG (or LC_ALL) set to the primary language; this is required by other parts of the system libraries.

This means that although LANGUAGE is used in order to determine the language to display message to, it won't be used until one of the other is set to something different than the default (C).

The final note makes it even clearer:

Note: The variable LANGUAGE is ignored if the locale is set to ‘C’. In other words, you have to first enable localization, by setting LANG (or LC_ALL) to a value other than ‘C’, before you can use a language priority list through the LANGUAGE variable.

So, in my case I had to set both LANG and LANGUAGE to a locale. The choice would be that of LANGUAGE variable regardless of the value of LANG.

Eypros
  • 521