Articles tagged 'i18n'
-
Rails 3.1 - Translating routes
October 26, 2011
This post was originally published in the Rambling Labs Blog on October 26, 2011.
Today, I was wondering if there would be a way to add translated routes automatically in Ruby on Rails. This is for a project I’m currently working on, whose users speak mostly spanish, so I want to make them happy with urls like “/contacto”, “/quienes-somos” and “/trabajos/1” instead of “/contact”, “/about-us”, and “jobs/1”.
So, I googled and there it was: the i18n_routing gem.
This reminded me one more time how awesome is the Ruby community, which is definitely one of the main reasons why I’m loving Ruby and Rails so much.
So back on topic, the gem is easy to install, and only depends on the i18n gem. Run
gem install i18n_routing
and you should be good…