blog.robotex.de

Rails3: Switch between locales

Assume you have a i18n toolbar on your page. To switch between locales, without switching the current page, you can link to the locale without setting any path:

  <%= link_to image_tag("application/icons/german.jpg"), url_for(:locale => :de) %>
  <%= link_to image_tag("application/icons/english.jpg"), url_for(:locale => :en) %>

Back