kwi / i18n_routing

I18n routing module for Rails 2.3.x and Rails 3. Translate your routes with ease !
MIT License
228 stars 48 forks source link

no route matches on route_paths with special charaters #16

Closed cpietsch82 closed 13 years ago

cpietsch82 commented 13 years ago

Hi all,

i have a problem with the correct translation of some words with special characters. Example in my routes.rb: localized(I18n.available_locales, :verbose => false) do ... match 'land/:id' => 'land#index', :as => :land ... end

In my YML file for Spain the translation for "land" is "país". named_routes_path: 'land/:id': "país/:id" ... You see the special character "í".

So when i start my rails application and switch the language to spanish and click on a link like (país/at-austria) that leads me to this error message: "No route matches "/pa%C3%ADs/at-austria" " All other routes without a special character in it, works correctly. Any suggestions or solutions?

P.S.: I'm using ruby 1.9.2p0 and Rails 3.0.3

Thanks! Christian

kwi commented 13 years ago

Hi Christian and thanks for reporting this bug. I think I already encountered this bug but it was coming from Rails, can you have a try by just creating a route without i18n routing named país. I think Rails will also escape it even if the gem is not involved.

Anyway, I'm not sure it's a good idea to put this kind of character in your url.

cpietsch82 commented 13 years ago

Now it works. My solution is to create a middleware which encodes the url correctly. With this i can have urls like "país" or something else.