16

I'm using Arabic as the default language but there are some issues when displaying it in terminal. So I want to change the language only in terminal to English, how can I do that ?

Burawi
  • 263
  • 1
  • 2
  • 5

3 Answers3

14

You can add a line

export LANG=C

to the end of your ~/.bashrc file and restart the terminal.

All program output will be in English.

Pilot6
  • 90,100
  • 91
  • 213
  • 324
  • 2
    You can just type this line as command in your open terminal session to change the language only inside this window and only until you close it. New windows will not be affected. To only run a single command in English, you can write the LANG=C directly in front of the command itself, e.g. LANG=C sudo apt-get update. @Pilot6: Maybe you want to [edit] that into your answer... – Byte Commander Sep 13 '15 at 19:59
  • @ByteCommander It is obvious that you can type it each time. The whole point is to set English output to all terminal commands. That was the question. – Pilot6 Sep 13 '15 at 21:39
  • 1
    this had changed all the system language at restart. Is there any way to change only terminal language ? – Burawi Sep 14 '15 at 05:14
  • 1
    @Burawi I updated the command. It works for me. It changes output only in terminal. It does not affect GUI. – Pilot6 Sep 14 '15 at 10:31
  • Are you sure you added it to the correct file? – Pilot6 Sep 14 '15 at 10:34
  • 1
    @Pilot6 Thank you so much! This was something I wanted to achieve for YEARS! Finally! :) – Muhammad bin Yusrat Apr 20 '17 at 02:30
  • For those wondering what this does, this turn off localization altogether : see https://superuser.com/questions/219945/why-lang-c-not-d-or-e-or-f – Max Aug 28 '19 at 13:14
2

An Alternative approach is to run this:

export LC_ALL=en_US.UTF-8

For more permanent solution for you own user account only just put the command above into ~/.bashrc file

You will see the change in your next terminal session. For an immediate change without the need of a new terminal session run:

source ~/.bashrc

In case of multiple terminal sessions (eg. using terminator) you will need to run the command above on each one of them.

So any terminal related error message will be in English (as fas as any gnu-utils related software).

0

I originally tried Pilot6's answer and it seemed to work (export LANG=C), but I quickly noticed that zsh (with oh-my-zsh) was glitching out.

This seems to fix it:

export LANG=

I got this answer from this thread.

Alexis
  • 1