title: How to tell OS X to set $LANG equal to the system language
body: <p>I had some problems lately with SSH sessions and wrong locale forwarded with <code>SendEnv</code>.</p>
  
  <p>I bought a German <em>MacBook</em> <em>Pro</em>, and am working with it set on English as system language (but sometime I also set it to Italian, when needed).</p>
  
  <p>Logging through SSH to some servers I noticed a lot of Warnings when running <code>perl</code>:</p>
  
  <pre><code>perl: warning: Please check that your locale settings:
      LANGUAGE = "en_GB:en",
      LC_ALL = (unset),
      LC_CTYPE = "UTF-8",
      LANG = "en_GB.UTF-8"
          are supported and installed on your system.
  perl: warning: Falling back to the standard locale ("C").
  </code></pre>
  
  <p>First I thought it could have been some misconfiguration on the servers, cause all of them were in German, and it could be that there were something missing for the other langauges.
  Then clarified with system administrator that everything was good on that side, and we found that I'm not getting the <em>$LANG</em> environment variable set.</p>
  
  <p>The weirder thing was that <em>$LANG</em> was set correctly when my system language was set on German, but <strong>WAS NOT JUST</strong> when I had my system language set to any other language than German (English or Italian in my case).</p>
  
  <p>Doing a couple of test showed that <strong><em>Mac</em> <em>OS</em> <em>X</em> (mine is <em>10.9.2</em>) doesn't set the <em>$LANG</em> variable when the language is different from the original language set for the MacBook.</strong></p>
  
  <p>Now the question:</p>
  
  <p>Is there a way to make <em>OS</em> <em>X</em> to set correctly the <em>$LANG</em> variable, even if I'm setting a language that is not the native place of production?</p>
  
  <p><strong>Or</strong></p>
  
  <p>Is there a way to <code>export LANG</code> so that it take the current language set in the System?
  The fix would be easy if I just used English (<code>export $LANG=en_GB.UTF-8</code>), but I'm also using Italian, so I cannot just set it statically in the <em>~/.bashrc_profile</em>.
  The alternative is to disallow the <code>SendEnv</code> in the <em>/etc/ssh_config</em>, but I would like to find a solution that could ADD a feature rather then REMOVE it.</p>