Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Organizers have no saved language

Aperta
#626 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
next.js, typescript

Direzione di ricerca

Start with #625 and the existing session flow in src/auth/organizer-session.ts, src/auth/bearer.ts, and src/mcp/context.ts; then read the locale helpers and Account Settings entry points named in the issue. Implement the stored locale, audience-filtered fallback order, and tests listed under “Done when,” including the database query check. Done means the listed lint, typecheck, knip, unit, and database commands pass.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement pipeline:proposed pipeline:ux

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 (#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 (#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.

Lingua principale
TypeScript
Stelle
19
Fork
4
Merge medio
21h 3m
PR unite (30g)
176

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di richshaw/OpenSignup

Tutte le issue di richshaw/OpenSignup

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.