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 :D Also tried namespace (yeah, didn''t work) and Rails3 scope :( -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Raul Murciano
2010-Apr-27 07:49 UTC
Re: Translated (language-aware) routes in Rails application
You may find useful my translate_routes plugin: http://github.com/raul/translate_routes -- Raul Murciano Freelance Web Developer - http://raul.murciano.net Ruby/Rails Trainer & Consultant - http://prorubyteam.com On Tue, Apr 27, 2010 at 9:27 AM, Paweł K <komrath-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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 :D Also tried namespace (yeah, didn''t work) and Rails3 scope :( > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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? On 27 Kwi, 09:49, Raul Murciano <r...-SclF2enkfyrk1uMJSBkQmQ@public.gmane.org> wrote:> You may find useful my translate_routes plugin: > > http://github.com/raul/translate_routes > > -- > Raul Murciano > Freelance Web Developer -http://raul.murciano.net > Ruby/Rails Trainer & Consultant -http://prorubyteam.com > > > > > > On Tue, Apr 27, 2010 at 9:27 AM, Paweł K <komr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > 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 :D Also tried namespace (yeah, didn''t work) and Rails3 scope :( > > > -- > > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en. > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
So there''s no way to achieve this effect without plugin? Like scope or namespace? On 27 Kwi, 09:49, Raul Murciano <r...-SclF2enkfyrk1uMJSBkQmQ@public.gmane.org> wrote:> You may find useful my translate_routes plugin: > > http://github.com/raul/translate_routes > > -- > Raul Murciano > Freelance Web Developer -http://raul.murciano.net > Ruby/Rails Trainer & Consultant -http://prorubyteam.com > > > > > > On Tue, Apr 27, 2010 at 9:27 AM, Paweł K <komr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > 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 :D Also tried namespace (yeah, didn''t work) and Rails3 scope :( > > > -- > > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en. > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Joe Smith
2010-Apr-28 16:32 UTC
Re: Translated (language-aware) routes in Rails application
"Paweł K" <komrath-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote in message news:9ced3922-bdfa-40f2-b5a8-0bf1e6518641-KDr+L/AxAMl2OZP9CLB5jGB/v6IoIuQBratpaaBEXXs@public.gmane.org>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. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.