🎃 Set up i18n in the frontend and translate the sidebar and sign-in form (DE, IT)
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
- 25/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ệ
- nextjs, react, typescript
- Lĩnh vực
- authentication, frontend, internationalization
Hướng nghiên cứu
Start with packages/frontend/src/app/layout.tsx, where the root layout sets <html lang> and is force-dynamic, then read proxy.ts, which must keep working unchanged. Next, look at the NAV array in components/app-sidebar.tsx and the !isRegister branch of app/login/page.tsx. Done when Playwright tests with test.use({ locale: 'de-DE' }) pass for the sidebar and sign-in form, a key-parity test over messages/{en,de,it}.json passes, and existing specs such as login-redirect-query.spec.ts still pass.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Part of the October Challenge #997.
Why
The website guides and the README already exist in German and Italian (content/guides/de, content/guides/it, README.de.md), but the admin UI is English only. Every string is hard-coded in JSX, <html lang="en"> is fixed (app/layout.tsx:72), and there is no i18n library. The only translated UI is the cookie banner (components/cookie-consent.tsx:37-391, browser language detection at :424-426), which only renders when GTM is configured. Teams whose staff work in German or Italian have to put up with an English admin UI, and adding a language later gets harder with every new page.
This issue lays the foundation and proves it on two surfaces: the sidebar and the sign-in form. Other pages follow in separate issues, one area at a time.
Self-hosted vs Cloud
- Self-hosted: same in Community and Business. Frontend only: no backend or database change, no
ee/code. - Cloud (
DEPLOYMENT_MODE=cloud): same image, same behaviour. The language is a per-browser preference stored in a cookie, not a workspace or instance setting, so members of one workspace can use different languages. - Who can use it: everyone, including signed-out visitors on
/login.
What to build
- Library:
next-intlin its "without i18n routing" setup. Reasons: it supports the App Router with server and client components, ICU messages (plurals such as "1 tool" / "3 tools") and typed message keys. Without routing there are no/de/...URL prefixes, so the auth gate inproxy.ts, the backend rewrites innext.config.tsand every?redirect=link keep working unchanged. Almost every page is a client component, so the messages are passed once throughNextIntlClientProviderin the root layout. Before you start, check that the currentnext-intlrelease supports thenextversion inpackages/frontend/package.json(16.x) and name the version in the PR. This Next.js version has breaking changes (seepackages/frontend/AGENTS.md), so read the docs it ships innode_modules/next/dist/docs/as well. Ifnext-intldoes not fit, comment here before building an alternative. - Locale resolution (server side): the cookie
amcp_localeif it holds a supported locale, otherwise the best match fromAccept-Language, otherwiseen. Supported:en,de,it. Set<html lang>from it inapp/layout.tsx:72. The root layout is alreadyforce-dynamic(:58), so reading the cookie per request costs nothing extra.app/global-error.tsx:30can stayen. - Messages:
packages/frontend/messages/{en,de,it}.json, nested by area (nav.*,signIn.*). English is the source. A key missing indeoritfalls back to English and never shows a raw key. - Sidebar (
components/app-sidebar.tsx): the group titles and item labels inNAV(:45-73), "Switch workspace" (:156), "Log out" (:188), "Settings" (:205), the "Workspace" fallback (:216) and the "Star on GitHub" texts (components/github-star-button.tsx:54-60).hrefs and the active-item logic stay as they are. - Sign-in form (
app/login/page.tsx:851-1144, sign-in mode only,!isRegister): heading, labels, placeholders, the submit button states, "Forgot password?", the recovery-code texts, the "or" divider, "Don't have an account? Register", "Email verified successfully!…", "Signing you in…", and the client-side messages shown in this mode. The registration and Cloud sign-up variants and the verification and licence steps stay English in this issue. - Language switcher: a select (English, Deutsch, Italiano) in Settings → Profile (
app/settings/page.tsx) and a small one under the sign-in card. It writes the cookie (one year,SameSite=Lax,Path=/) and callsrouter.refresh(). - Translations: match the tone of the existing German and Italian guides in
content/guides/deandcontent/guides/it. If you are not a native speaker of one of the languages, say so in the PR so a maintainer can review those strings. - Contributor note: a short "Translating the UI" section in
.github/CONTRIBUTING.md: where the messages live, how to add a key, English is the source.
Where to look
packages/frontend/src/app/layout.tsx:51-89: root layout (force-dynamic,<html lang>).packages/frontend/src/app/providers.tsx: client providers to wrap.packages/frontend/src/proxy.ts: auth gate and public paths; must keep working unchanged.packages/frontend/src/components/app-sidebar.tsx:45-73,:156,:188,:205,:216.packages/frontend/src/app/login/page.tsx:851-1144: the auth form.packages/frontend/src/components/cookie-consent.tsx:37-391,:424-426: the banner's own translations (leave them as they are).packages/frontend/src/lib/translation-safe-dom.ts: keeps browser page translation from crashing React; keep it.packages/frontend/tests/e2e/: many tests match English text, so English must stay the result forAccept-Language: en-US, Playwright's default.
Acceptance criteria
- Without the cookie,
Accept-Language: de-DErenders/loginand the sidebar in German with<html lang="de">;it-ITgives Italian;fr-FRgives English. - A language chosen in Settings persists across reloads and sign-out.
- Playwright tests for the cases above (
test.use({ locale: 'de-DE' })), plus a key-parity test that loads the three JSON files and fails whendeoritmisses or adds a key. All existing tests pass unchanged (cd packages/frontend && npm run test:e2e). - URLs are unchanged:
login-redirect-query.spec.tsandlogin-redirect-safe.spec.tspass. -
npm run lint,npx tsc --noEmit -p tsconfig.jsonandnpm run buildpass inpackages/frontend. - Screenshots of the sidebar and the sign-in form in German and Italian in the PR.
Out of scope
- Other pages (follow-up issues), the backend-rendered OAuth sign-in and consent pages (
packages/backend/src/auth/auth-page.ts), emails and API error messages. - Locale-prefixed URLs, right-to-left languages, languages other than German and Italian.
- Storing the language on the user account.
- Changing date or number formatting.
Size
L (several days, may be split: library, locale resolution and sidebar first; sign-in form and switcher second).
How to claim
Comment "I'd like to work on this" and we'll assign you. Rules in #997.
- Ngôn ngữ chính
- TypeScript
- Star
- 856
- Fork
- 82
- Merge trung bình
- 5 giờ 45 phút
- Pull request đã merge (30 ngày)
- 158
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 HelpCode-ai/anythingmcp
-
Docs: document all SMTP_* and other undocumented env vars for self-hostingCó thể đã có người làm @notlakshitha đã nhận 4 ngày trước. Đang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
HelpCode-ai/anythingmcp#1049 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue hacktoberfest
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 70/100
HelpCode-ai/anythingmcp#996 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue hacktoberfest
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 72/100
HelpCode-ai/anythingmcp#995 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement good first issue hacktoberfest help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
HelpCode-ai/anythingmcp#982 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Upload the new social previewCó thể đã có người làm @helpcodeai đã nhận 4 ngày trước. Đang mở
HelpCode-ai/anythingmcp#1087 · 6 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của HelpCode-ai/anythingmcp
Issue tương tự
-
bug priority: P2
Độ 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 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 73/100
mattermost/compass-design#106 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:other issue-rating: 🦞 diamond lobster P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
openclaw/openclaw#176671 · 1 bình luận · 1 reaction ·
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
nordcraftengine/nordcraft#1400 ·
Maintainer thường phản hồi trong vòng 1 ngày