How to check if current locale is equal to a string
You should use symbol instead of string when searching/comparing/setting locale. Try:
<% if I18n.locale == :es %>
Documentation for I18n is there http://guides.rubyonrails.org/i18n.html
In my case
if I18n.locale.to_s == 'zh-CN'
...
did the trick.