if i18n.locale==

April 21, 2012

Fun with Rails again. Was trying to get a link to show up only if the locale was Japan. Tried this:

<% if i18n.locale == i18n.ja %>

But no. This:

<% if i18n.locale == "ja" %>

Didn’t work either. Searched around and found the answer in a preso by one of my COOKPAD team members. Hope to someday try out Jens’s i18n_toolbox as well.

<% if i18n.locale == :ja %>

Discussion, links, and tweets

Good Morning!