fixes locales issue
This commit is contained in:
parent
c2c1961bd0
commit
47405b5b19
1 changed files with 28 additions and 29 deletions
|
@ -8,7 +8,6 @@ module Foodsoft
|
|||
before_filter :set_locale
|
||||
end
|
||||
|
||||
module InstanceMethods
|
||||
def explicitly_requested_language
|
||||
params[:locale]
|
||||
end
|
||||
|
@ -28,7 +27,8 @@ module Foodsoft
|
|||
protected
|
||||
|
||||
def select_language_according_to_priority
|
||||
explicitly_requested_language || session_language || browser_language
|
||||
language = explicitly_requested_language || session_language || browser_language
|
||||
language.to_sym unless language.blank?
|
||||
end
|
||||
|
||||
def available_locales
|
||||
|
@ -45,7 +45,6 @@ module Foodsoft
|
|||
locale = session[:locale] = ::I18n.locale
|
||||
logger.info("Set locale to #{locale}")
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue