I'm converting a site into the Rails based Refinery CMS, I've setup the i18n refinery cms gem and I've created multi-lingual versions of my pages. I'd like to create a locale switcher on the page, so that a user can click on a flag and switch between the various languages for the particular page that they are on.
How can I get the available languages for a page, and their respective links?
# In a controller
::I18n.locale = params[:locale]
<!-- In a view with a dropdown -->
<ul id="menu1" class="dropdown-menu" role="menu" aria-labelledby="drop4">
<% Refinery::I18n.frontend_locales.each do |frontend_locale| %>
<li>
<%= link_to Refinery::I18n.locales[frontend_locale], refinery.url_for(:locale => frontend_locale) %>
</li>
<% end %>
</ul>