francesc / rails-translate-routes

MIT License
147 stars 50 forks source link

Routes inside scopes with conditional variables are not translated #33

Open JonasNielsen opened 12 years ago

JonasNielsen commented 12 years ago

With this i18n-routes.yml:

da:
  routes:
    foo: julemand
    too: nissepige

There is a problem with scopes that include conditional variables:

namespace :myspace do
  scope "/:user_id" do
    get 'foo' => 'foo#bar' # Is translated correctly
    # myspace_julemand_da GET  /da/myspace/:user_id/julemand(.:format)
  end
  scope "/(:user_id)" do
    get 'too' => 'too#bar' # Is not translated :(
    # myspace_too_da GET  /da/myspace(/:user_id)/too(.:format)
  end
end

Which surely must be a bug?

I wanted to add a failing test, but there isn't any :-)

tigus commented 10 years ago

Hi i have exactly the same problem

when a scope is optionel the routes are not translated

someone have a solution ?

tx