Skip to content

feat(registry): add next-intl localized routes (en/fr)#386

Merged
bntvllnt merged 1 commit into
mainfrom
feat/issue-281-i18n
Jun 4, 2026
Merged

feat(registry): add next-intl localized routes (en/fr)#386
bntvllnt merged 1 commit into
mainfrom
feat/issue-281-i18n

Conversation

@bntvllnt
Copy link
Copy Markdown
Collaborator

@bntvllnt bntvllnt commented Jun 4, 2026

Fresh next-intl i18n implementation (re-done on current main; supersedes closed #350).

What

  • next-intl localized routes with [locale] segment + middleware (localePrefix: as-needed), locales en (default) + fr.
  • All 21 HTML pages moved under app/[locale]/ — incl. /templates, /design, /releases, /changelog that feat(registry): add next-intl localized routes #350 didn't cover. Route handlers (llms/rss/atom/r/mcp/og) stay English at root.
  • Header language switcher added alongside pagefind search + What's-new dropdown + GitHubMark.
  • Locale-aware canonical + hreflang; en/fr message catalogs + localized MDX (home/docs/components/philosophy) reused from feat(registry): add next-intl localized routes #350.

Validation

  • pnpm --filter @vllnt/ui-registry build green (966 static pages, en+fr cross-product) · tsc --noEmit clean.
  • Lockfile based on main (eslint-plugin-react-hooks held at 7.0.1; only next-intl transitive additions).

Notes

  • Landing page content left English literals (routing/metadata localized); deliberate to avoid inventing translations.
  • Recommend a quick visual pass on /, /fr, and the locale switcher post-merge.

Closes #281

Introduce next-intl i18n with a `[locale]` route segment, middleware, and
`localePrefix: "as-needed"` for the registry app (locales: en default, fr).

- Add i18n config (locales, routing, request) + en/fr message catalogs
- Add root middleware via createMiddleware(routing), excluding /api, /_next,
  static files, and the machine/agent route handlers (mcp, r/*, *.xml, *.txt)
- Wire createNextIntlPlugin('./i18n/request.ts') into next.config.mjs alongside
  MDX + output: standalone
- Move all HTML pages under app/[locale]/; root layout becomes pass-through and
  [locale]/layout.tsx renders html/body + NextIntlClientProvider +
  setRequestLocale with generateStaticParams for all locales
- Per page: await locale param, call setRequestLocale, extend
  generateStaticParams with the locale cross-product for dynamic slugs, and
  emit locale-aware canonical + hreflang alternates
- Make lib/content, lib/seo, lib/og, lib/sidebar-sections locale-aware
  (backward-compatible defaults to en); content resolver prefers
  content/pages/<slug>/<locale>.mdx with flat fallback for docs/<slug>
- Header: add Languages locale switcher (i18n Link + usePathname), keep
  pagefind SearchDialog, "What's new" dropdown, and GitHubMark
- Keep route handlers (api/og, *.xml, *.txt, mcp, r/*) at app/ root in English
- Add next-intl dependency; lockfile regenerated from main base
@vllnt-pilot
Copy link
Copy Markdown

vllnt-pilot Bot commented Jun 4, 2026

Preview ready · Updated 2026-06-04T16:31:58Z

Service Status Preview
ui-registry Ready https://pr-386-ui-registry.preview.vllnt.ai
Inspect
  • Tailnet-only by default (not reachable from public internet)
  • Cert: real Let's Encrypt wildcard
  • Reply with /clean to destroy this preview now

@bntvllnt bntvllnt merged commit 61cce77 into main Jun 4, 2026
9 checks passed
@bntvllnt bntvllnt deleted the feat/issue-281-i18n branch June 4, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: i18n with next-intl + per-locale MDX content (content/<slug>/<locale>.mdx)

1 participant