Skip to content

Instantly share code, notes, and snippets.

@tdelam
Forked from nicinabox/controller.rb
Created March 15, 2012 14:08
Show Gist options
  • Save tdelam/2044363 to your computer and use it in GitHub Desktop.
Save tdelam/2044363 to your computer and use it in GitHub Desktop.
Setting i18n translations in Refinery
# In a controller
# This is not necessary when using the view code below
::I18n.locale = params[:locale]
<!-- In a view with a dropdown -->
<ul class="dropdown-menu">
<% Refinery::I18n.frontend_locales.each do |locale| %>
<li>
<%= link_to Refinery::I18n.built_in_locales[locale], {:locale => locale} %>
</li>
<% end %>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment