add configuration for default language
This commit is contained in:
parent
3f032e5dd9
commit
03585e272f
2 changed files with 11 additions and 3 deletions
|
@ -34,6 +34,13 @@ default: &defaults
|
||||||
# documentation URL for the apples&pears work system
|
# documentation URL for the apples&pears work system
|
||||||
applepear_url: https://github.com/foodcoops/foodsoft/wiki/%C3%84pfel-u.-Birnen
|
applepear_url: https://github.com/foodcoops/foodsoft/wiki/%C3%84pfel-u.-Birnen
|
||||||
|
|
||||||
|
# Default language
|
||||||
|
#default_locale: en
|
||||||
|
# By default, foodsoft takes the language from the webbrowser/operating system.
|
||||||
|
# In case you really want foodsoft in a certain language by default, set this to true.
|
||||||
|
# When members are logged in, the language from their profile settings is still used.
|
||||||
|
#ignore_browser_locale: false
|
||||||
|
|
||||||
# price markup in percent
|
# price markup in percent
|
||||||
price_markup: 2.0
|
price_markup: 2.0
|
||||||
|
|
||||||
|
|
|
@ -25,13 +25,14 @@ module Foodsoft
|
||||||
end
|
end
|
||||||
|
|
||||||
def default_language
|
def default_language
|
||||||
::I18n.default_locale
|
FoodsoftConfig[:default_locale] or ::I18n.default_locale
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def select_language_according_to_priority
|
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?
|
language.to_sym unless language.blank?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue