]> cat aescling's git repositories - mastodon.git/commitdiff
If DEFAULT_LOCALE is set, enforce it instead of HTTP request locale (#6817)
authorEugen Rochko <eugen@zeonfederated.com>
Sun, 18 Mar 2018 15:57:04 +0000 (16:57 +0100)
committerGitHub <noreply@github.com>
Sun, 18 Mar 2018 15:57:04 +0000 (16:57 +0100)
Fix #6784

app/controllers/concerns/localized.rb

index e697284a8c74e8404973cc1d52642671f0f69e90..abd85ea27a8f064316f21de4eec8df3948d6df5e 100644 (file)
@@ -17,7 +17,11 @@ module Localized
   end
 
   def default_locale
-    request_locale || I18n.default_locale
+    if ENV['DEFAULT_LOCALE'].present?
+      I18n.default_locale
+    else
+      request_locale || I18n.default_locale
+    end
   end
 
   def request_locale