feat(registry): add next-intl localized routes (en/fr)#386
Merged
Conversation
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
|
Preview ready · Updated 2026-06-04T16:31:58Z
Inspect
|
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.
Fresh next-intl i18n implementation (re-done on current main; supersedes closed #350).
What
[locale]segment + middleware (localePrefix: as-needed), locales en (default) + fr.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.Validation
pnpm --filter @vllnt/ui-registry buildgreen (966 static pages, en+fr cross-product) ·tsc --noEmitclean.Notes
Closes #281