16

I am running OS-X El-Capitan with MacPorts. System language of my Mac is Spanish. How can I tell gnupg to use English as language for any output such as error messages?

I have installed gpg 1.4.19 via macports and gpg 2.0.28 via GPGTools. Both gpg -h and gpg2 -h produce Spanish output, while other unix commands such as git --help or man -h produce English output.

In this post a similar problem is discussed, but I could not apply the recommendations given there to my OS: http://www.gossamer-threads.com/lists/gnupg/users/52908

kinnla
  • 411
  • 4
  • 13

1 Answers1

31

Like lots of other internationalized tools, GnuPG takes the LANG environment variable into account. Either export the variable for the whole session, where it will be valid for all executed applications from this terminal (you could also add this to your dotfiles):

export LANG=en
gpg --version

or prefix LANG=en for individual calls of gpg if you only want to run it in English language a single time:

LANG=en gpg --version
Jens Erat
  • 37,523
  • 16
  • 80
  • 96
  • Thanks, Jens! Works exactly as you describe it. I included `LANG=en` in my .profile, and now gpg speaks English with me. – kinnla Nov 28 '15 at 23:02
  • For example, but if you do so, you will switch all command line tools to English language. An alternative might be setting `alias gpg='LANG=en gpg'` there. – Jens Erat Sep 07 '17 at 19:30
  • 1
    This doesn't cover the case where gpg is used as external program. For example git. I have set up alias as `alias gpg='LANG=en gpg'` but when I use `git tag -v `, the output is not in English. – Hologos Dec 18 '18 at 10:06
  • That's because an alias will only be evaluated by the shell, not git. You could still provide some kind of wrapper-script, or you have to apply that "alias-hack" to `git` already (environment will be inherited). – Jens Erat Dec 18 '18 at 16:56