Translated (language-aware) routes in Rails application

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 :smiley: Also tried namespace (yeah, didn't work) and Rails3 scope :frowning:

You may find useful my translate_routes plugin:

  http://github.com/raul/translate_routes

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?

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

"Paweł K" <komrath@gmail.com> wrote in message news:9ced3922-bdfa-40f2-b5a8-0bf1e6518641@k33g2000yqc.googlegroups.com...

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.