feat(i18n): localize the entire site into 15 languages#21
Merged
Conversation
Add a header language switcher and full-site localization across 15
locales (en, zh, es, ar, fr, de, ja, ko, pt, ru, hi, id, vi, tr, it)
using next-intl with sub-path routing (English stays unprefixed).
- Move the app tree under src/app/[locale]/; add src/proxy.ts request
interceptor (Next 16 renamed middleware -> proxy) and
src/i18n/{routing,navigation,request}.ts. Strings live in
messages/<locale>.json (20 namespaces, 551 keys each) with per-key
English fallback.
- Localize all visitor/account/admin pages + shared components; ICU
plural/number formatting replaces count-in-sentence concatenation;
LocaleSwitcher preserves path + query when switching.
- SEO: per-locale <html lang>, hreflang + x-default, localized og:locale,
per-locale sitemap alternates, prefixed-locale robots disallows.
- RTL support for Arabic (dir + logical Tailwind utilities).
- DB-driven content (agent/skill/category text) intentionally untranslated.
- en + zh hand-checked; the other 13 locales are AI-translated
(ICU-validated + key-parity-checked) and should get native review
before being treated as production-final.
- Add scripts/check-i18n.mjs + a CI workflow that fails on locale key
drift or invalid ICU.
- Fix a pre-existing bug: src/app/mcp/route.ts wasn't awaiting
checkRateLimit, so that endpoint's rate limiting never triggered.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
next-intl needs @swc/helpers@0.5.23 as a nested dependency (next pins 0.5.15 at the top level). The lock generated locally with npm 11 omitted that nested node, which npm 10 rejects — breaking `npm ci` in both the new i18n CI workflow and the Dockerfile (node:20-alpine). Regenerated the lock inside node:20-alpine so `npm ci` succeeds in the deploy environment. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a header language selector and full-site localization into 15 languages via next-intl.
Locales: English · 简体中文 · Español · العربية (RTL) · Français · Deutsch · 日本語 · 한국어 · Português · Русский · हिन्दी · Bahasa Indonesia · Tiếng Việt · Türkçe · Italiano.
What changed
/agentsstays; others get/zh/agents, …) — no redirects for existing URLs. The app tree moved undersrc/app/[locale]/; the request interceptor issrc/proxy.ts(Next 16 renamedmiddleware.ts→proxy.ts). Config insrc/i18n/{routing,navigation,request}.ts.messages/<locale>.json— 20 namespaces, 551 keys each, with per-key English fallback. All visitor/account/admin pages + shared components localized. ICU plural/number formatting replaces{n} agent{s}concatenation.LocaleSwitcherpreserves path + query.<html lang>, hreflang +x-defaulton every page, localizedog:locale, per-URL sitemap<xhtml:link>alternates, and prefixed-localerobotsdisallows.dir="rtl"+ a physical→logical Tailwind sweep (ml→ms,text-left→text-start, …).scripts/check-i18n.mjs+ a workflow that fails on locale key drift or invalid ICU. Run locally withnpm run check:i18n.src/app/mcp/route.tswasn'tawaitingcheckRateLimit, so that endpoint's rate limiting was silently dead (and it blockednext build's type check).Verification
next buildgreen — 0 type errors, all 283 static pages generate.@formatjsICU parser with full key parity (npm run check:i18n✓).next buildprints ametadataBasewarning (×11) from the file-convention OG image during static gen; the renderedog:imageis correct (https://takoapi.com/opengraph-image) — noise, not a defect.🤖 Generated with Claude Code