routing Translated Paths

16 views
Skip to first unread message

Erwin

unread,
Jan 5, 2013, 2:07:30 PM1/5/13
to rubyonra...@googlegroups.com
Happy new 2013 !  we're still on our nice blue planet !!

I am using translated path in my project, working fine 

  scope '/:locale'  do
       ...
      scope(:path_names => { :new => I18n.t(:new, :scope => :paths), :edit => I18n.t(:edit, :scope => :paths) }) do
        resources :contacts, :only => [:new, :create], :path => I18n.t(:contacts, :scope => :paths)
        resources :portfolios, :only => [:show], :path => I18n.t(:portfolios, :scope => :paths)
        resources :craftworks, :only => [:index, :show], :path => I18n.t(:craftworks, :scope => :paths)
        resources :posts, :only => [:index, :show], :path => I18n.t(:posts, :scope => :paths)
      end

starting the app with the default locale being :fr, I get all the routes translated ... BUT
when a user switch the locale to :en, then the resources paths are translated to english.. but not the path_names :  
:new  and edit  are still in french .. what could be wrong  ?

thanks for feedback


Erwin

unread,
Jan 6, 2013, 3:08:13 AM1/6/13
to rubyonra...@googlegroups.com
[SOLVED]  found the gem  rails-translate-routes ... so easy  ! 
Reply all
Reply to author
Forward
0 new messages