Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,14 @@ def has_access?

def set_locale
store_locale_to_cookie(params[:locale]) if locale
I18n.locale = cookies[:locale] || I18n.default_locale
I18n.locale = locale_value
end

def locale_value
return I18n.default_locale unless cookies[:locale].present?
return I18n.default_locale unless I18n.available_locales.include?(cookies[:locale].to_sym)

cookies[:locale]
end

def user_not_authorized
Expand Down