Module: Padrino::Contrib::AutoLocale::Helpers
- Defined in:
- lib/padrino-contrib/auto_locale.rb
Instance Method Summary collapse
-
#switch_to_lang(lang) ⇒ Object
This reload the page changing the I18n.locale.
Instance Method Details
#switch_to_lang(lang) ⇒ Object
This reload the page changing the I18n.locale
24 25 26 |
# File 'lib/padrino-contrib/auto_locale.rb', line 24 def switch_to_lang(lang) request.path_info.sub(/\/#{I18n.locale}/, "/#{lang}") if settings.locales.include?(lang) end |