Pawel_K
(Paweł K)
April 27, 2010, 7:27am
1
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
You may find useful my translate_routes plugin:
  http://github.com/raul/translate_routes
Pawel_K
(Paweł K)
April 27, 2010, 8:02am
3
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?
Pawel_K
(Paweł K)
April 27, 2010, 8:04am
4
So there's no way to achieve this effect without plugin? Like scope or
namespace?
Joe_Smith
(Joe Smith)
April 28, 2010, 4:32pm
5
"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.