Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Padrino::Contrib::AutoLocale doesn't work with some controllers #5

Open
basex opened this issue Dec 14, 2011 · 3 comments
Open

Padrino::Contrib::AutoLocale doesn't work with some controllers #5

basex opened this issue Dec 14, 2011 · 3 comments

Comments

@basex
Copy link
Contributor

basex commented Dec 14, 2011

If you have regex controllers it won't work because on line 43 will try to compare a regex against other regex.

https://github.com/padrino/padrino-contrib/blob/master/lib/padrino-contrib/auto_locale.rb

@DAddYE
Copy link
Member

DAddYE commented Dec 14, 2011

Mmm nice catch ... any ideas to solve it?

@basex
Copy link
Contributor Author

basex commented Dec 19, 2011

Instead of having the url and padrino_route_added method, can't you just change the request.path_info before being evaluated by the controllers?

On line 36 adding something like request.path_info.sub(//#{I18n.locale}/, "/")

@dariocravero
Copy link

@DAddYE thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants