Translating devise routes

151 views
Skip to first unread message

Michał Krzyzanowski

unread,
Aug 29, 2010, 6:00:46 PM8/29/10
to I18n Routing
Hi,
I'm using devise gem in my app.
I would like to translate it's routes (such as /users/sign_in) - but
I've no idea how.
pl:
routes:
users:
as: "uzytkownicy"
seems to not working... is there any way to translate that routes?

Kwi

unread,
Aug 30, 2010, 5:13:50 PM8/30/10
to I18n Routing
Hi Michal,

Right now, in order to translate a route, you should use "localized
do".
And Devise does not ! I don't know how Devise declares its routes, but
you need to localize them at that time.

Sorry, I can't help you more right now as I don't have any experience
with Devise yet.

Good luck :)


On Aug 30, 12:00 am, Michał Krzyzanowski

Michał Krzyzanowski

unread,
Aug 31, 2010, 5:25:07 AM8/31/10
to I18n Routing
Hi,
right now I've got in my routes.rb sth like this:
localized([:pl], :verbose => true) do
devise_for :users
#etc
end
rake routes shows me that routes:
new_user_session GET /users/
sign_in(.:format) {:controller=>"devise/
sessions", :action=>"new"}
user_session POST /users/
sign_in(.:format) {:controller=>"devise/
sessions", :action=>"create"}
destroy_user_session GET /users/
sign_out(.:format) {:controller=>"devise/
sessions", :action=>"destroy"}
user_password POST /users/
password(.:format) {:controller=>"devise/
passwords", :action=>"create"}
new_user_password GET /users/password/
new(.:format) {:controller=>"devise/
passwords", :action=>"new"}
edit_user_password GET /users/password/
edit(.:format) {:controller=>"devise/
passwords", :action=>"edit"}
user_password PUT /users/
password(.:format) {:controller=>"devise/
passwords", :action=>"update"}
user_registration POST /users/
registration(.:format) {:controller=>"devise/
registrations", :action=>"create"}
new_user_registration GET /users/registration/
sign_up(.:format) {:controller=>"devise/
registrations", :action=>"new"}
edit_user_registration GET /users/registration/
edit(.:format) {:controller=>"devise/
registrations", :action=>"edit"}
user_registration PUT /users/
registration(.:format) {:controller=>"devise/
registrations", :action=>"update"}
user_registration DELETE /users/
registration(.:format) {:controller=>"devise/
registrations", :action=>"destroy"}

So, You still don't know how to localize it?

On 30 Sie, 23:13, Kwi <guillaume.luccis...@gmail.com> wrote:
> Hi Michal,
>
> Right now, in order to translate a route, you should use "localized
> do".
> And Devise does not ! I don't know how Devise declares its routes, but
> you need to localize them at that time.
>
> Sorry, I can't help you more right now as I don't have any experience
> with Devise yet.
>
> Good luck :)
>
> On Aug 30, 12:00 am, Micha³ Krzyzanowski
Reply all
Reply to author
Forward
0 new messages