Skip to content

Organizers have no saved language #626

Closed

Description

@richshaw

Needs your OK: this adds a language to each organizer's account, used for their new signups now and for the app itself later. Nothing shows until Swedish ships; the privacy page says we store it. Swap pipeline:proposed for pipeline:ready to have it built.

What happens

New signups should start in their organizer's language (the next step in #619), and later the app should use it too. There's nowhere to keep it:

  • The browser's Accept-Language is a weak guess. Many Swedes run their phones in English.
  • AI assistants have no browser at all. They create signups through MCP.

Fix, in outline

  • organizers.locale: a nullable text column, added with a Drizzle migration. It's lenient like the signup's (A signup has no language, and an instance has no default language #625).

  • getOrganizerLocale(session, acceptLanguage | null) in src/i18n/organizer.ts works out the effective language, in this order:

    1. the saved value;
    2. DEFAULT_LOCALE, when the operator set it (A signup has no language, and an instance has no default language #625);
    3. on a browser request, the browser's top-ranked Accept-Language language, if it's shipped (only the top one: normal negotiation would match sv,en;q=0.8 to English);
    4. English.

    Each step is filtered by the audience's SHIPPED list.

  • No new query. OrganizerSession gains locale, selected in the query loadOrganizerSessionById already runs (src/auth/organizer-session.ts). It travels through getOrganizerSession() to routes, and through BearerResolution (src/auth/bearer.ts) into the MCP ToolContext (src/mcp/context.ts), because tool handlers may not query the database themselves.

  • MCP passes null for the browser. An assistant's Accept-Language is the vendor's, not the organizer's.

  • updateOrganizerLocale(db, actor, locale) lets an organizer change only their own. The value must be in SHIPPED.participant.

  • Account Settings gets "Language for new signups", rendered only when SHIPPED.participant has more than one entry.

  • The privacy page says we store the organizer's language setting, and its "Last updated" date moves.

Watch for

  • Keep it out of src/i18n/server.ts. The worker imports that file under tsx, and getOrganizerLocale may need next/headers.
  • Sign-in and bearer code go to the owner as high risk.
  • Tests that build OrganizerSession by hand gain the field: src/auth/bearer.test.ts, src/oauth/flow.db.test.ts and src/app/app/signups/[id]/preview/page.test.tsx.
  • The Auth.js adapter and the e2e seed's organizer insert are unaffected by a nullable column.

Choices this makes

  • Store it on the organizer, not in a cookie. Default: a column. It works without a browser, follows them across devices, and needs no cookies-page change.
  • One setting for new signups now and the app later. Default: one. Someone who wants the app in English but signups in Swedish changes each signup's language in its Settings tab; a second setting can come if people ask for it.
  • The order: saved → DEFAULT_LOCALE → the browser's first language → English.

Order

After #625, because defaultFor, DEFAULT_LOCALE and the lenient-language rule come from it.

Done when

  • Unit tests cover every step of the order, including MCP's null and a sv,en;q=0.8 browser before Swedish ships.
  • A db test shows loadOrganizerSessionById returns locale with no extra statement.
  • pnpm lint && pnpm typecheck && pnpm knip && pnpm test and pnpm test:db pass.

Planned with the owner in https://claude.ai/code/session_01EFKmj716ZY3b3SwR8TV8Y2 and checked against the code on main at 35288fa. The full plan is private to the owner's account: https://claude.ai/artifact/VgQH6U2s2EVx3LX991fJi8 (a Claude session on that account can open it with the Artifact tool's read action). This is part of step 1.1 there.

Activity

  1. added
    enhancement
    on Oct 25, 2026
  2. added
    pipeline:ux
    on Oct 25, 2026
  3. added
    pipeline:working
    and removed on Nov 14, 2026
  4. self-assigned this
    on Nov 14, 2026
  5. removed
    pipeline:working
    on Nov 14, 2026
  6. removed
    pipeline:ux
    on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions