Friday, August 26, 2011

How to make the command's output language to English

Today, I installed gnupg which is a open source tool by FSF. Installing gnupg was simply in order to use `git tag -s "tag name"` to sign the tag. I used 'HomeBrew' to install it on my Mac. The installation was satisfactory, only after the installation, when I type 'gpg' on the command line, it showed me Japanese translation. WTF!?

I guess it could be some kind of settings read from system, but there should also be a way to modify this. After a few minutes of googling, I found out that we need to set an environment variable to make it show English at any circumstances. Here is how:

Add the following line to your ".bashrc" if you are using bash, or other shell's configuration file.

`export LC_MESSAGES="en.utf-8"`

Actually, you can also use 

`export LC_MESSAGES=C`

The difference is `C` is only showing the ASCII, but en.utf-8 will support unicode.

See more on Bash's environment variable list:

type `env` on the command line to see all environment variables set to the system. 

Good luck to anybody else who has the some trouble as me!

No comments:

Post a Comment