LANG variable wrong in iTerm2, where's the bug?

Today I noticed that when opening TortoiseHG the app was in Dutch (partially, not fully translated it seems). Looking around in my environment I found out that LANG=nl_NL.UTF-8.

It is indeed true that my locale is set to NL (i.e. number formats and all) but my language in OS X is set to English and I would expect my apps to be in English aswell. A locale is quite different from a language.

So my question is now, where do I report this bug to? Is it an iTerm2 issue or do I need to file a bug report somewhere else?

My goal is to have my number format according to Dutch standards (i.e. 123.456 = 123 thousand and 456 and my language still at English. OS X gets this, iTerm2 (or at least, TortoiseHG started from iTerm2) does not.

System Preferences - LanguageSystem Preferences - Region

# locale
LANG="nl_NL.UTF-8"
LC_COLLATE="nl_NL.UTF-8"
LC_CTYPE="nl_NL.UTF-8"
LC_MESSAGES="nl_NL.UTF-8"
LC_MONETARY="nl_NL.UTF-8"
LC_NUMERIC="nl_NL.UTF-8"
LC_TIME="nl_NL.UTF-8"
LC_ALL=

Versions:

  • OS X: 10.8.2
  • iTerm 2: 1.0.0.20120724
  • TurtoiseHG: 2.4

The following will do the trick: Navigate to the iTerm2 -> Preferences -> Profiles -> Terminal and unset the "Set local variables automatically" in Environment section.


In both iTerm and Terminal the LC_ variables depend on the region selected in System Preferences (defaults read -g AppleLocale) by default. Both have preferences for using the C locale though:

  • iTerm: Preferences > Profiles > Terminal > Set locale variables automatically
  • Terminal: Preferences > Settings > Advanced > Set locale environment variables on startup

You could also add export LANG=C to your shell profile.

$ defaults read -g AppleLocale
ja_JP
$ locale
LANG="ja_JP.UTF-8"
LC_COLLATE="ja_JP.UTF-8"
LC_CTYPE="ja_JP.UTF-8"
LC_MESSAGES="ja_JP.UTF-8"
LC_MONETARY="ja_JP.UTF-8"
LC_NUMERIC="ja_JP.UTF-8"
LC_TIME="ja_JP.UTF-8"
LC_ALL=
$ dddd
-bash: dddd: コマンドが見つかりません
$ export LANG=C
$ dddd
-bash: dddd: command not found