Use browser Accept-Language for login and onboarding locale (#768)

* Use Accept-Language for unauthenticated locale

* Add per-user locale overrides

* Fix test

* Use more than the top `accept-language` entry

* Localization of string
This commit is contained in:
Juan José Mata
2026-01-24 22:00:41 +01:00
committed by GitHub
parent 959029fda6
commit c7ab25b866
21 changed files with 163 additions and 17 deletions

View File

@@ -39,6 +39,7 @@ class User < ApplicationRecord
validate :ensure_valid_profile_image
validates :default_period, inclusion: { in: Period::PERIODS.keys }
validates :default_account_order, inclusion: { in: AccountOrder::ORDERS.keys }
validates :locale, inclusion: { in: I18n.available_locales.map(&:to_s) }, allow_nil: true
# Password is required on create unless the user is being created via SSO JIT.
# SSO JIT users have password_digest = nil and authenticate via OIDC only.