Class: Spree::LocaleController
Instance Method Summary
collapse
#cart_link, #unauthorized
Instance Method Details
#set ⇒ Object
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# File 'app/controllers/spree/locale_controller.rb', line 5
def set
requested_locale = params[:switch_to_locale] || params[:locale]
if locale_is_available?(requested_locale)
I18n.locale = requested_locale
session[set_user_language_locale_key] = requested_locale
flash.notice = t('spree.locale_changed')
else
flash[:error] = t('spree.locale_not_changed')
end
redirect_to spree.root_path
end
|