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)?
More information: What does "LC_ALL=C" do?
Open a terminal Ctrl+Alt+T and type:
Now the terminal output is in english language. You can check it with
It is possible to make a command to do that with a permanent
Restart the Bash shell. Now you have the command
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
Call it with
In general I suggest to change all 3 environment variables
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
Easiest way is to open the terminal by pressing Alt+F2 and running this command:
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:
The “plain” locale, with all messages untranslated, default time and number formats, ASCII as the character set, etc. is called
Thus, to run a program with messages in English, run
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.