How can I switch the command output language from my native language to English, so I can post my Ask Ubuntu question with English command output (error messages)?
How can I switch the command output language from my native language to English, so I can post my Ask Ubuntu question with English command output (error messages)?
export LC_ALL=C
is enough. All subsequent command output will be in English.More information: What does "LC_ALL=C" do?
If you want to revert to the native language, unset the
LC_ALL
variable:bash function for terminal
Here is my bash function to switch between DE and EN locales.
You may extend this code with your preferred languages. To use this, put it in your
~/.bashrc
(or~/.bash_profile
)-Call it with
_configure_locale EN
to switch to English.In general I suggest to change all 3 environment variables
LC_ALL
,LANG
,LANGUAGE
to avoid misbehaviours of some programs.Adapting to your language
Extending the code to your native language is quite simple. You can find the needed values by invoking the following command
Open a terminal Ctrl+Alt+T and type:
or:
Now the terminal output is in english language. You can check it with
locale
.It is possible to make a command to do that with a permanent
alias
. Open the.bashrc
file with your preferred editor and put the following code in there:or:
Restart the Bash shell. Now you have the command
basheng
. Type it in the Bash to get an english Bash shell. To leave the english shell typeexit
.Source:
This is configured via locale settings, which can be set via environment variable. There are four layers of variables; the first one that is set takes precedence:
LANGUAGE
— don't use it, it's rarely useful and can cause bugs. Unfortunately, some versions of Ubuntu set it, so you may need to unset it.LC_ALL
— overrides category-specific settings, meant primarily to be used by programs that want to run in the default locale. Not meant to be used as global settings.LC_
:LC_CTYPE
,LC_MESSAGES
,LC_TIME
, ….LANG
— sets the default locale for all categories, meant to be used in a global user settings.The “plain” locale, with all messages untranslated, default time and number formats, ASCII as the character set, etc. is called
C
. This locale is present on every system.Thus, to run a program with messages in English, run
or
To run a program with all localization turned off, run
but beware that this switches the character encoding to ASCII (so no Unicode, latin-1, etc.).
See What should I set my locale to and what are the implications of doing so? for a more detailed overview of locales.
in your
~/.bashrc
then
Check it
Why unset first?
https://help.ubuntu.com/community/Locale
Easiest way is to open the terminal by pressing Alt+F2 and running this command:
Related bug to language change/switching settings in Fedora(30) ex: ENG to Native to ENG
There is env variable that doesn't change back to EN, namely for example from Bulgarian (bg). Example:
has to change to:
Solution(remove # and execute):
Done.
To change the terminal language to English permanently, use: