Closed Krule closed 14 years ago
Hum, That's very weird ! So you are using Rails3 ? Wich beta ? And did you test is in production ?
beta4, and yes, tested in production
Do you change the I18n.load_path somewhere And can u try to test if the translations are loaded ?
Translation are loaded for the rest of the application. Load path is not changed, only config.i18n.default_locale.
Hum, right now I have no clue, did you get this thing work since last time ? This could be interesting to know ! Maybe this come from something related to heroku ?
I have figured it out. It loaded on development because after touching routes.rb, they were reloaded after I18n has been initialized. Otherwise routes were initialized before I18n so they had no idea what translations to use.
After I have changed the above code to:
localized('en', :verbose => true) do
resources :nepremicnines do
collection do
get :obcino
end
end
end
everything started working.
For a very short while I had:
%x[touch #{RAILS_ROOT}/config/routes.rb]
In my ApplicationController.set_locale, but that was not a real solution.
I think this one can be closed. The only thing left for me is to figure out how to link to same page on different language now.
Ah, glad to know everything finally went well ! I will probably add your solution in the wiki.
For your links to the same page in different language, you just need to change the locale just before creating the link, I think ?
Thanks Krule.
i've got the same problem.
Is this solution correct? %x[touch #{RAILS_ROOT}/config/routes.rb]
I think that such a solution is only temporary. need to find appropriate
That solution worked for a while. Later on I used https://github.com/kwi/i18n_routing/issues/issue/9/#issue/9/comment/325092 solution and it worked for a while. All of this was actual for Rails 3.0.0.beta4.
Later on I had some issues, but all of them got resolved after Rails 3.0. final was out.
So, It's just you need to pass the locales to localized right? I may put an alert if there is no locale found during the load, it might help !
@kwi I am not sure what exact problem is with @wacaw's app. For me everything started working perfectly with no hacks after 3.0. was out and your first release after that.
Ok, looks great so :) Thanks !
This is a weird one, translated routes work (when I look at rake routes), however in case I start server they fail to translate. Then, when I edit the gemfile while server is on, routes start working. If I restart it again they stop until gemfile is edited.
My route looks like:
And en.yml:
Since my production is on Heroku, with it's read-only fs, this is a bit of a problem for me.