0

I am trying to add i18n to Refinery CMS with added Inquiries gem. Everything is fine until I add links for switching locales , like this :

= link_to_unless_current image_tag('flag_bulgaria.png'), locale: "bg"

Then routing error appears :

No route matches {:locale=>"bg", :controller=>"refinery/inquiries/inquiries", :action=>"new"}

I have added the refinery-I18n gem ,also have added locales in the initializer file . I have tried to add before filter for setting the locale in the application_controller , but no results . I have read all the discussions about refinery i18n and found nothing about the problem . I'm using rails 3.2.6 , refinery cms 2.0.4 , refinerycms-inquiries 2.0.3 .

Thank you for helping me .

R Milushev
  • 4,295
  • 3
  • 27
  • 35
  • I was surprised by the lightning-fast reaction from Philip Arndt (RefineryCMS) . The answer he gave me (google.groups) works like charm : =link_to "Other locale", refinery.url_for(locale: 'bg') .Thank you again , @parndt. – R Milushev Aug 06 '12 at 18:26

1 Answers1

2

Remember to use refinery.url_for in your link. Here is my language selector.

     <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>