nextjs-intl

Configure next-intl v4 internationalization for Next.js 16 App Router projects with static export.

Updated Mar 29, 2026
One-click install
npx skills add https://github.com/r-senchuk/agentskills --skill nextjs-intl-r-senchuk
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: nextjs-intl
Source: https://github.com/r-senchuk/agentskills/tree/main/.agents/skills/nextjs-intl
Command: npx skills add https://github.com/r-senchuk/agentskills --skill nextjs-intl-r-senchuk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires next-intl, and includes references (resource) components.

What problem does it solve? Setting up internationalization in Next.js 16 App Router projects involves many moving parts — locale routing, message files, locale switchers, hreflang tags, and static export constraints — and misconfigurations cause cryptic build failures like "Unable to find next-intl locale". This Skill provides a complete, ordered procedure to configure next-intl v4 correctly the first time. ## Core Features & Use Cases - Routing and Messages Setup: Creates defineRouting config, navigation helpers, request config, and per-locale JSON message files with identical key structure. - Static Export Support: Handles output: 'export' requirements including setRequestLocale, generateStaticParams, and the decision to skip src/proxy.ts in favor of CDN-level redirects. - SEO and Components: Builds locale switchers using @/i18n/navigation and generates hreflang tags from the routing config. - Use Case: You are building a bilingual (English/Italian) marketing site with Next.js 16 static export. Use this Skill to scaffold the full i18n layer, add a locale switcher, and verify all locale directories appear in the out/ build output. ## Quick Start Set up next-intl internationalization in my Next.js 16 App Router project with English and Italian locales, English as default, and static export enabled.

Frequently Asked Questions about nextjs-intl

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up next-intl in a Next.js App Router project?▼

Install next-intl with pnpm, then create src/i18n/routing.ts with defineRouting, src/i18n/navigation.ts with createNavigation, and src/i18n/request.ts with getRequestConfig. Wrap next.config.ts with createNextIntlPlugin and add one JSON message file per locale under messages/.

How to make next-intl work with Next.js static export?▼

For output: 'export', every page.tsx and layout.tsx under [locale] must call setRequestLocale(locale) from params before any translation function, and the layout must define generateStaticParams returning all locales. Skip src/proxy.ts entirely and handle the root redirect at your CDN or static host.

Why does next-intl fail with "Unable to find next-intl locale"?▼

This build error means a server component is missing setRequestLocale(locale) before calling useTranslations, getTranslations, or getMessages. Add the call to every page and layout under the [locale] segment, using the locale from async params.

Can I use next-intl middleware with static export?▼

No, src/proxy.ts middleware is unsupported with output: 'export' because redirects require a server. Configure your static host or CDN to redirect / to the default locale, or link only to locale-prefixed URLs.

Should I use next-intl or next-i18next for Next.js?▼

next-intl supports the App Router and static export, while next-i18next is designed for the Pages Router only. For Next.js 16 App Router projects, use next-intl v4; this Skill does not cover next-i18next or server-side-only i18n.