svenfuchs / routing-filter

routing-filter wraps around the complex beast that the Rails routing system is, allowing for unseen flexibility and power in Rails URL recognition and generation.
http://www.artweb-design.de
MIT License
464 stars 84 forks source link

Locale selector #8

Closed andresgutgon closed 13 years ago

andresgutgon commented 14 years ago

Once i running with routing-filter, what is the best way to change locale in views?

Example: Chose Languge: English | Español | French

How i can accomplish this?

I have this in application_controller.rb def set_user_language
I18n.locale = logged_in? ? current_user.profile.language.to_s : request.env['rack.locale'] end

I look in user's preferences and browser's preferences but i want to display links with languages

svenfuchs commented 13 years ago

Hi Andres,

Your question is a general Rails I18n question and does not relate to the routing-filter gem. Please check out http://edgeguides.rubyonrails.org/i18n.html

andresgutgon commented 13 years ago

Thanks i made a gist with my thoughs https://gist.github.com/535725