views:

33

answers:

1

Hello. I want simple thing. Translate routes with I18n like this

get I18n.t('routes.login') => "devise/sessions#new", :as => :new_user_session

I made file initilizers/locale.rb with

I18n.default_locale = :cz

It works perfectly when i run 'rake routes', but when i run server it ignore default locale and throw 'translation missing message'

Any suggestion what is happening and why ?

A: 

I belive, that normally routes are loaded once, even before locale are set, so you simply can't use the logic you have here. You need more advanced stuph to get it to work. Take a look on i18n_routing

http://github.com/kwi/i18n_routing
mdrozdziel