| Module | Padrino::Contrib::AutoLocale |
| In: |
lib/padrino-contrib/auto_locale.rb
|
This extension give to padrino the ability to change their locale inspecting.
class MyApp < Padrino::Application
register AutoLocale
set :locales, [:en, :ru, :de] # First locale is the default locale
set :locale_exclusive_paths, ['/js', '/css', '/img'] # asset uri paths which shouldn't be localized
end
# view.haml
=link_to "View this page in RU Version", switch_to_lang(:ru)
So when we call an url like: /ru/blog/posts this extension set for you :ru as I18n.locale