kwi / i18n_routing

I18n routing module for Rails 2.3.x and Rails 3. Translate your routes with ease !
MIT License
228 stars 48 forks source link

Having hard time trying to get it to work #2

Closed ahto closed 14 years ago

ahto commented 14 years ago

I'm using ruby 1.9.2dev (2010-05-28 revision 28049) [x86_64-darwin10] Rails is -> gem 'rails', :git => 'http://github.com/rails/rails.git' And I have this in my Gemfile gem 'i18n_routing'

I have this in my routes.rb localized([:en, :fi], :verbose => true) do match 'about' => 'contents#about', :as => :about end

and locale files are following en: named_routes_path: about: 'a-propos'

fi: named_routes_path: about: 'fi-propos'

rake routes prints these [I18n] > localize route : about (en) => /a-propos [I18n] > localize route : about (fi) => /fi-propos

but when i hit localhost:3000/a-propos or fi-propos i get No route matches "/a-propos" or No route matches "/fi-propos"

Also the <%= link_to 'about', about_path %> prints out just about

Could you help me debug this, I really don't know what to do next.

Thanks.

kwi commented 14 years ago

Hello ahto,

That seems strange as the debug output looks good ! How do you set the current I18n.locale ?

Maybe it's a change in the latest rails git. I will have a deeper look at this tomorrow. I keep you aware.

And thanks for the feedback !

kwi commented 14 years ago

Ok, it's look like it's come from the latest rails3 edge. Until it's fixed, I recommend you to use the Rails3 beta3

kwi commented 14 years ago

So, after a deeper look, in fact it was coming from the I18n.load_path that was not set at Rails3 boot, I do not know why :) So I have released a new version, and now it's automatically set for you by i18n_routing.

It's look like this in the code : I18n.load_path = (I18n.load_path << Dir[Rails.root.join('config', 'locales', '*.yml')]).uniq