about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/lib/language_detector.rb2
-rw-r--r--app/mailers/notification_mailer.rb2
-rw-r--r--app/models/account.rb1
3 files changed, 3 insertions, 2 deletions
diff --git a/app/lib/language_detector.rb b/app/lib/language_detector.rb
index 8c1751beb..ca5cb2591 100644
--- a/app/lib/language_detector.rb
+++ b/app/lib/language_detector.rb
@@ -35,6 +35,6 @@ class LanguageDetector
   end
 
   def default_locale
-    account&.user&.locale || I18n.default_locale
+    account&.user_locale || I18n.default_locale
   end
 end
diff --git a/app/mailers/notification_mailer.rb b/app/mailers/notification_mailer.rb
index f308c403b..a944db137 100644
--- a/app/mailers/notification_mailer.rb
+++ b/app/mailers/notification_mailer.rb
@@ -71,7 +71,7 @@ class NotificationMailer < ApplicationMailer
   private
 
   def locale_for_account(account)
-    I18n.with_locale(account.user.locale || I18n.default_locale) do
+    I18n.with_locale(account.user_locale || I18n.default_locale) do
       yield
     end
   end
diff --git a/app/models/account.rb b/app/models/account.rb
index a28dc967f..c2dc77d93 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -111,6 +111,7 @@ class Account < ApplicationRecord
            :current_sign_in_ip,
            :current_sign_in_at,
            :confirmed?,
+           :locale,
            to: :user,
            prefix: true,
            allow_nil: true