{
}[http://badge.fury.io/rb/translatable_routes] {
}[https://codeclimate.com/github/museways/translatable_routes] {
}[https://travis-ci.org/museways/translatable_routes] {
}[https://gemnasium.com/museways/translatable_routes]
= Translatable Routes
Minimalistic toolkit to translate routes.
= Install
Put this line in your Gemfile:
gem 'translatable_routes'
Then bundle:
$ bundle
= Usage
Inside each locale yaml file:
es:
routes:
users: "usuarios"
profile: "perfil"
login: "entrar"
(Please note each part of the path it's translated individually, you don't have to put translations for paths like "users/1/profile" just translate "users" and "profile", the plugin will do the rest)
In your config/routes.rb use the localized block to decide wich routes will be translated:
localized do
get 'about' => 'pages#about'
end
The helpers inside views and controllers will continue working the same but I18n.locale will be use as default locale:
about_path # /en/about