add configuration for default language
This commit is contained in:
parent
3f032e5dd9
commit
03585e272f
2 changed files with 11 additions and 3 deletions
|
|
@ -25,13 +25,14 @@ module Foodsoft
|
|||
end
|
||||
|
||||
def default_language
|
||||
::I18n.default_locale
|
||||
FoodsoftConfig[:default_locale] or ::I18n.default_locale
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def select_language_according_to_priority
|
||||
language = explicitly_requested_language || session_language || user_settings_language || browser_language
|
||||
language = explicitly_requested_language || session_language || user_settings_language
|
||||
language ||= browser_language unless FoodsoftConfig[:ignore_browser_locale]
|
||||
language.to_sym unless language.blank?
|
||||
end
|
||||
|
||||
|
|
@ -52,4 +53,4 @@ module Foodsoft
|
|||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue