mirror of
https://github.com/we-promise/sure
synced 2026-04-25 17:15:07 +02:00
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:
6
db/migrate/20260124180211_add_locale_to_users.rb
Normal file
6
db/migrate/20260124180211_add_locale_to_users.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class AddLocaleToUsers < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
add_column :users, :locale, :string, null: true, default: nil
|
||||
add_index :users, :locale
|
||||
end
|
||||
end
|
||||
4
db/schema.rb
generated
4
db/schema.rb
generated
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[7.2].define(version: 2026_01_23_214127) do
|
||||
ActiveRecord::Schema[7.2].define(version: 2026_01_24_180211) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "pgcrypto"
|
||||
enable_extension "plpgsql"
|
||||
@@ -1402,9 +1402,11 @@ ActiveRecord::Schema[7.2].define(version: 2026_01_23_214127) do
|
||||
t.datetime "set_onboarding_goals_at"
|
||||
t.string "default_account_order", default: "name_asc"
|
||||
t.jsonb "preferences", default: {}, null: false
|
||||
t.string "locale"
|
||||
t.index ["email"], name: "index_users_on_email", unique: true
|
||||
t.index ["family_id"], name: "index_users_on_family_id"
|
||||
t.index ["last_viewed_chat_id"], name: "index_users_on_last_viewed_chat_id"
|
||||
t.index ["locale"], name: "index_users_on_locale"
|
||||
t.index ["otp_secret"], name: "index_users_on_otp_secret", unique: true, where: "(otp_secret IS NOT NULL)"
|
||||
t.index ["preferences"], name: "index_users_on_preferences", using: :gin
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user