I've added the option to match the route translation for named routes by their name and not the path. I found it a little cumbersome for a project with existing routes to add all of them by their path and not the actual route name. Routes may change a lot during development, but the name usually does not.
Example:
routes.rb
ActionController::Routing::Routes.draw do |map|
map.localized do
map.welcome 'welcome/to/our/page', :controller => 'welcome', :action => 'index'
end
end
The defaults still apply. When a named route can't be found in :named_routes then look for it in :named_routes_path. The example above shows the case for :en, when a named route is present, as well as for :fr, when named_routes_path is defined.
Hi all,
I've added the option to match the route translation for named routes by their name and not the path. I found it a little cumbersome for a project with existing routes to add all of them by their path and not the actual route name. Routes may change a lot during development, but the name usually does not.
Example:
routes.rb
The defaults still apply. When a named route can't be found in :named_routes then look for it in :named_routes_path. The example above shows the case for :en, when a named route is present, as well as for :fr, when named_routes_path is defined.
Best, Rudi