Skip to content
chubas edited this page Jan 23, 2011 · 8 revisions

Install i18n gem, if you don’t have it on your system

gem install i18n

Simply declare a localized block in your routes.rb, and then insert in it every routes you want to be localized.

map.localized(I18n.available_locales, :verbose => true) do
  map.about 'about', {:controller => 'contents', :action => :about}

  map.resources :users
  map.resource  :contact
end

The plugin will try to translate routes for each locales you pass to the localized method.
If you do not pass any options to localized, it will use I18n.available_locales

Clone this wiki locally