# Translated (language-aware) routes in Rails application

**URL:** <https://www.ruby-forum.com/t/translated-language-aware-routes-in-rails-application/187639>\
**Category:** Rails\
**Created:** [April 27, 2010, 9:29am UTC](https://www.ruby-forum.com/t/translated-language-aware-routes-in-rails-application/187639 "2010-04-27T09:29:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![PaweSSSSSK](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/838e76/32.png) [@PaweSSSSSK](https://www.ruby-forum.com/u/PaweSSSSSK)\
**Post date:** [April 27, 2010, 9:29am UTC](https://www.ruby-forum.com/t/translated-language-aware-routes-in-rails-application/187639/1 "2010-04-27T09:29:04Z")

</div>

Hi,

I’d like to have translated languate-aware routes in my application,  
like:

/projects/5/permissions =\> locale “PL”  
/projekty/5/pozwolenia =\> locale “PL”

Is there any way to achieve it with RESTful routes? I have done it  
manually with named routes, but it’s overwhelming with over 300  
routes 😃 Also tried namespace (yeah, didn’t work) and Rails3 scope ☹

---

<div class="post-metadata">

**Author:** ![PaweSSSSSK](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/838e76/32.png) [@PaweSSSSSK](https://www.ruby-forum.com/u/PaweSSSSSK)\
**Post date:** [April 27, 2010, 9:54am UTC](https://www.ruby-forum.com/t/translated-language-aware-routes-in-rails-application/187639/2 "2010-04-27T09:54:16Z")

</div>

You may find useful my translate\_routes plugin:

[GitHub - raul/translate\_routes: Rails plugin to translate your URLs and routing helpers on an clean way.](http://github.com/raul/translate_routes)

–  
Raul M.  
Freelance Web D. - [http://raul.murciano.net](http://raul.murciano.net)  
Ruby/Rails Trainer & Consultant - [http://prorubyteam.com](http://prorubyteam.com)

---

<div class="post-metadata">

**Author:** ![PaweSSSSSK](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/838e76/32.png) [@PaweSSSSSK](https://www.ruby-forum.com/u/PaweSSSSSK)\
**Post date:** [April 27, 2010, 10:04am UTC](https://www.ruby-forum.com/t/translated-language-aware-routes-in-rails-application/187639/3 "2010-04-27T10:04:13Z")

</div>

Thanks Raul, this plugin is exactly what I wanted and looks really  
promising - so I suppose there’s no particular way to do this without  
any plugin?

---

<div class="post-metadata">

**Author:** ![PaweSSSSSK](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/838e76/32.png) [@PaweSSSSSK](https://www.ruby-forum.com/u/PaweSSSSSK)\
**Post date:** [April 27, 2010, 10:05am UTC](https://www.ruby-forum.com/t/translated-language-aware-routes-in-rails-application/187639/4 "2010-04-27T10:05:23Z")

</div>

So there’s no way to achieve this effect without plugin? Like scope or  
namespace?

---

<div class="post-metadata">

**Author:** ![PaweSSSSSK](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/838e76/32.png) [@PaweSSSSSK](https://www.ruby-forum.com/u/PaweSSSSSK)\
**Post date:** [April 28, 2010, 6:35pm UTC](https://www.ruby-forum.com/t/translated-language-aware-routes-in-rails-application/187639/5 "2010-04-28T18:35:05Z")

</div>

“PaweÅ‚ K” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote in message  
news:removed\_email\_address@domain.invalid…

> So there’s no way to achieve this effect without plugin? Like scope or  
> namespace?

Not really. I mean, if manually work work for you, other than the number  
of  
lines, why don’t you use iteration?

ROUTE\_TRANSLATION\_SUPPORTED\_LOCALES.each{ |loc|  
map “/#{I18n.t(‘Projects’, :locale =\> loc)}” =\>“Projects#index”

# etc.

}

But if you want to be able to have the RESTful route helpers, and have  
them  
return translated routes, you will need a plugin.
