fix(account): seed a fresh guest's interface language from the client locale

A guest was provisioned with only its detected time zone; its PreferredLanguage
fell to the 'en' column default. The client already sends its locale in the guest
login (GuestLoginRequest.locale), but the gateway dropped it and ProvisionGuest
took no language — so a Russian user's brand-new native guest got English
language-dependent server content (the ad banner, bot messages) until the client's
later language reconcile. Read the locale in the gateway guest handler, thread it
through GuestAuth -> ProvisionGuest, and seed PreferredLanguage from it (validated;
an unsupported/absent value keeps the 'en' default). Wire field already present —
no schema change.
This commit is contained in:
Ilia Denisov
2026-07-15 00:06:23 +02:00
parent b5fe61279b
commit f8aeec8008
9 changed files with 48 additions and 19 deletions
+1 -1
View File
@@ -216,7 +216,7 @@ func TestConfirmCodeClearsGuest(t *testing.T) {
mailer := &capturingMailer{}
svc := account.NewEmailService(store, mailer, "https://erudit-game.ru")
guest, err := store.ProvisionGuest(ctx, "")
guest, err := store.ProvisionGuest(ctx, "", "")
if err != nil {
t.Fatalf("provision guest: %v", err)
}