Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

A signup has no language, and an instance has no default language

オープン
#625 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
next.js, typescript

調査の方向性

Start with src/i18n/config.ts, src/lib/env.ts, and src/schemas/signups.ts, then follow how signup settings are parsed and how toPublicSignup exposes fields. Check the Settings tab, MCP registry snapshots, and the listed docs and changelog. Done means the language setting and fallback behavior match the stated rules, tests cover the cases in the issue, and the listed checks pass.

索引モデルが issue の本文から書いたものです。

説明

enhancement pipeline:proposed pipeline:ux

Needs your OK: this stores a language on each signup and adds an optional DEFAULT_LOCALE setting for operators. Nothing shows in the app until Swedish ships (the launch step in #619). The MCP update_signup description and the public signup API gain a locale. Swap pipeline:proposed for pipeline:ready to have it built.

What happens

Nothing records which language a signup is written in, so its pages and emails can't follow it. An operator who runs OpenSignup for one language community, a Swedish school for example, has no way to say so.

Fix, in outline

  • settings.locale in SignupSettingsSchema (src/schemas/signups.ts), stored as z.string().max(35).optional(). It's lenient on purpose: an unknown stored value must not make the whole settings object fail to parse, which would break requiresEmail, sendsReminders, the Build tab's parse and every later update.
  • Validate only a value the caller sent. createSignup and updateSignup reject a language outside SHIPPED.participant with invalid_input. updateSignup merges the stored settings under the patch before parsing, so checking the merged object would make every unrelated save fail on a signup whose stored language has since left the list. It's the same trap sentGroupBy already avoids.
  • Read it with resolveLocale(value, fallback), pure, in src/i18n/config.ts: the value if it's in CATALOG_LOCALES, else the fallback.
  • DEFAULT_LOCALE, an optional runtime variable in src/lib/env.ts (z.enum(CATALOG_LOCALES).optional(); a bad value fails at startup like any env error). When set, it's the instance's language.
  • defaultFor(audience, instanceDefault), pure, in config.ts: the instance's language when it's set and in that audience's SHIPPED list, else 'en', so an operator who sets sv early doesn't get half-translated pages. Only instanceDefaultLocale() in src/i18n/server.ts calls getEnv().
  • A "Signup language" control in the signup's Settings tab: a plain form like "Ask for an email address", with no client JS, rendered only when SHIPPED.participant has more than one entry. So nothing shows yet.
  • API and MCP.
    • Add locale to toPublicSignup's allow-list (src/app/s/[slug]/public-signup.ts), so API clients can mark the content's language.
    • update_signup gets the setting automatically, since its settings schema derives from SignupSettingsSchema. Add a .describe() listing the allowed values, and update the registry snapshots.
  • Docs.
    • An .env.example entry.
    • A line in the README's "Branding your instance": set it when the instance serves one language community, and leave it unset to follow each organizer's browser.
    • Where a runtime variable goes on each platform: .env for Docker Compose, [env] or fly secrets on Fly.
    • Say plainly that setting it also switches every signup that has no language of its own (all signups made before this work) to that language at once.

Watch for

  • Keep config.ts pure. env.ts imports CATALOG_LOCALES from it, so the reverse import would be a cycle, and unit tests don't set DATABASE_URL.
  • It's not a build argument. Nothing statically prerendered needs it, so it needs no NEXT_PUBLIC_ prefix and no Dockerfile wiring.
  • Check docs/connect-ai-assistant.md if it lists settings, and add a CHANGELOG entry.

Choices this makes

  • Store it in settings (jsonb). Default: yes. No migration, no new query.
  • DEFAULT_LOCALE is optional, and when set it comes before the browser's guess for organizers (the next step). Default: yes, so a self-hosted Swedish school is Swedish whatever its organizers' phones say. opensignup.org leaves it unset.

Order

After #620, because CATALOG_LOCALES and SHIPPED come from it.

Done when

  • Tests: a sent unknown language is refused; a stored unknown language doesn't break requiresEmail, sendsReminders or an unrelated settings save; resolveLocale and defaultFor cases.
  • The Settings control renders when SHIPPED.participant has two entries (a test) and not otherwise.
  • 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.

主要言語
TypeScript
スター
19
フォーク
4
平均マージ
19時間 34分
マージ済み PR(30日)
165

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

richshaw/OpenSignup のほかの issue

richshaw/OpenSignup の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。