|
|
@ -7,8 +7,6 @@ module Localized
|
|
|
|
around_action :set_locale
|
|
|
|
around_action :set_locale
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def set_locale
|
|
|
|
def set_locale
|
|
|
|
locale = current_user.locale if respond_to?(:user_signed_in?) && user_signed_in?
|
|
|
|
locale = current_user.locale if respond_to?(:user_signed_in?) && user_signed_in?
|
|
|
|
locale ||= session[:locale] ||= default_locale
|
|
|
|
locale ||= session[:locale] ||= default_locale
|
|
|
@ -19,6 +17,8 @@ module Localized
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
|
|
|
|
def default_locale
|
|
|
|
def default_locale
|
|
|
|
if ENV['DEFAULT_LOCALE'].present?
|
|
|
|
if ENV['DEFAULT_LOCALE'].present?
|
|
|
|
I18n.default_locale
|
|
|
|
I18n.default_locale
|
|
|
|