If DEFAULT_LOCALE is set, enforce it instead of HTTP request locale ()

Fix 
lolsob-rspec
Eugen Rochko 2018-03-18 16:57:04 +01:00 committed by GitHub
parent cabb197337
commit 77badbc85a
1 changed files with 5 additions and 1 deletions
app/controllers/concerns

View File

@ -17,8 +17,12 @@ module Localized
end end
def default_locale def default_locale
if ENV['DEFAULT_LOCALE'].present?
I18n.default_locale
else
request_locale || I18n.default_locale request_locale || I18n.default_locale
end end
end
def request_locale def request_locale
preferred_locale || compatible_locale preferred_locale || compatible_locale