OpenSignup has no message catalogs or translator, so none of its text can be translated
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 38/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- eslint, next.js, node.js, playwright, typescript
- Lĩnh vực
- backend, internationalization, testing, tooling
Hướng nghiên cứu
Start with next.config.mjs, eslint.config.mjs, budgets.json, and the worker test at src/email/templates/worker-render.test.ts; inspect the existing package, test, and lint setup before adding the translator plumbing. The issue lists the required catalog and i18n entry points, plus checks to run: lint, typecheck, knip, tests, build, and budgets. Done means translation works in server, test, and worker contexts, client imports are rejected by lint, and first-load JavaScript budgets pass.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Needs your OK: this adds next-intl and the translation plumbing the rest of #619 builds on. Nothing anyone sees changes. Swap pipeline:proposed for pipeline:ready to have it built.
What happens
Every string a person sees is typed inline, in English, in components, emails and helpers. There's no catalog to translate and no function to look a message up. Text is rendered in three places with different limits:
- Server components, the bulk of the app.
'use client'bundles, whose sizebudgets.jsoncaps.- The pg-boss worker (
pnpm worker, plain Node undertsx, no Next runtime), which renders the reminder and time-changed emails.
Fix, in outline
- Packages. Add
next-intlanduse-intlat the same exact version. pnpm's isolatednode_moduleswon't resolveuse-intl/coreas a transitive dependency, and knip flags unlisted imports. Wrapnext.config.mjswithcreateNextIntlPlugin, keepingoutput: 'standalone',serverExternalPackagesandheaders()as they are. - Catalog.
src/messages/en.json, undersrc/because the runner image copies onlysrc/and the worker runs from it (a rootmessages/folder would crash the first reminder job in production). Top-level namespaces by audience:participant,email,organizer,auth,site,common. Types come from next-intl'sAppConfigaugmentation overen.json, so a missing key or a wrong argument fails typecheck. src/i18n/config.ts, pure (nonext/*, noenv.ts):CATALOG_LOCALES(justenfor now) andSHIPPED = { participant: ['en'], organizer: ['en'], site: ['en'] }, the languages complete and reviewed for each audience.src/i18n/translator.ts:getTranslator(locale, namespace, { onError }), synchronous, built onuse-intl/core'screateTranslatorover the catalogs imported as modules. English is merged under the requested language per namespace, so a gap shows English, not a key path likeparticipant.signUp. No logging import, because Playwright specs import app copy modules. It returns the same function typeuseTranslationsdoes, so a helper written against it also works in a client component.src/i18n/server.ts: passes anonErrorthat logs one pino line per missing key. The worker will import it, so nothing fromnext/*goes in it.src/i18n/request.ts: the request config the plugin requires. For now it returnsenandtimeZone: 'UTC'.- A lint rule keyed on the
'use client'directive, in a small local ESLint plugin ineslint.config.mjs: a client file may not import the translator,server.tsor a catalog, since each carries every language. Client files live outside any fixed directory list, so read the file's leading directive rather than matching paths. - Tests: an English test translator whose
onErrorthrows, so a missing key fails a test. - knip: entries for the request config and the catalogs, with a comment saying why.
Watch for
- Don't use next-intl's server hooks (
getTranslations, oruseTranslationsin server components). 18 jsdom test files render server components synchronously withrender(), and async components would break them. Server code takes a translator fromgetTranslator. server-onlycan't guard the translator: it throws undertsxand vitest. The lint rule andpnpm budgets(a client chunk with every catalog in it blows the 108 KB*budget) are the guards.- Move no copy yet beyond what the tests need. Extraction comes in later steps of #619.
- Pieces with no caller yet wait for the step that first uses them (
resolveLocale,defaultFor, language names, the client provider wrapper), or knip fails.
Choices this makes
- next-intl, over Lingui, Paraglide, react-intl and i18next. Default: next-intl. Measured client runtimes (esbuild, minified, gzip, React excluded): use-intl 11.6 KB, or 2.8 KB with its
precompileoption (a later step); Lingui 3.4 KB, but its macros need an SWC plugin tied to Next's exactswc_coreand can't run undertsx; Paraglide 2 is built for Vite and fetches plugins from a CDN at build time; react-intl 14.9 KB; i18next 17.2 KB. - ICU MessageFormat in JSON. Default: yes. Translation tools such as Weblate read it.
- One synchronous translator for server code, emails, the worker and tests, with next-intl's React provider only around client components that need text. Default: yes.
Done when
getTranslator('en', …)works in a server component, in a unit test, and under the worker toolchain (thesrc/email/templates/worker-render.test.tspattern).- A client file that imports the translator fails lint.
- No page's first-load JS changes (
pnpm build && pnpm budgets). pnpm lint && pnpm typecheck && pnpm knip && pnpm testpass.
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 step 0.1 there.
- Ngôn ngữ chính
- TypeScript
- Star
- 19
- Fork
- 4
- Merge trung bình
- 22 giờ 10 phút
- Pull request đã merge (30 ngày)
- 168
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của richshaw/OpenSignup
-
Participant name and notes limits are typed twice, in the schemas and on the participant pagesCó thể đã có người làm @bfs2021 đã nhận 1 ngày trước. Đang mởenhancement good first issue pipeline:ready
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
richshaw/OpenSignup#705 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement pipeline:proposed pipeline:ux
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
richshaw/OpenSignup#654 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement pipeline:proposed pipeline:ux
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
richshaw/OpenSignup#652 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement pipeline:proposed pipeline:ux
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
richshaw/OpenSignup#589 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement pipeline:proposed pipeline:ux
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
richshaw/OpenSignup#588 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của richshaw/OpenSignup
Issue tương tự
-
e2e-failure ready-to-code
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
redhat-developer/rhdh-plugin-export-overlays#4616 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-handle
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
nextlevelbuilder/dewee-web-v2#73 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
backend bug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
PoCInnovation/Distribox#255 ·
Maintainer thường phản hồi trong vòng 1 ngày