padrino/padrino-contrib — Issue #5: Padrino::Contrib::AutoLocale doesn't work with some controllers
Author: basex
Created: 2011-12-14 02:54:43+00:00
State: open

If you have a controller like 'get :page, :map => "/:permalink" do |permalink|' you get "wrong number of arguments (2 for 1)", because it expects :lang to be one of the arguments, if you have regex controllers it doesn'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

Before there was a version that would get which locale was on the url and then would set the I18n.locale and get the language out of the url, to be processed by the regular controller, for some unknown reason with the last versions of the http_router I'm unable to this because it's impossible to change the request.path_info in runtime.

Old version of the auto_locale
https://github.com/padrino/padrino-contrib/blob/395caf370ade69528e23b05de930a2b2d0135589/lib/padrino-contrib/auto_locale.rb