title: How to check if current locale is equal to a string
body: <p>I'm trying to determine whether to show the <code>Spanish</code> or <code>English</code> button on my web application.</p>
  
  <pre><code>&lt;% if I18n.locale == 'es' %&gt;
    &lt;a href="&lt;%= set_english_path %&gt;" class="thin"&gt;English&lt;/a&gt;
  &lt;% else %&gt;
    &lt;a href="&lt;%= set_spanish_path %&gt;" class="thin"&gt;Spanish&lt;/a&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>The <code>if</code> condition <strong>always</strong> fails and the Spanish button is always displayed.</p>
  
  <p>RubyMine show this upon inspection (during debugging):</p>
  
  <p><img src="https://i.stack.imgur.com/28u7R.png" alt="enter image description here"></p>
  
  <p>So why is the comparison failing?</p>