next-intl-app-router

Implement next-intl locale-prefixed routing and dynamic message loading in Next.js App Router.

1|Updated Jan 28, 2026
One-click install
npx skills add https://github.com/ENG-BXI/SAAS-SMART-SHIPMENT-TRACKING-CLIENT-SIDE --skill next-intl-app-router-eng-bxi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: next-intl-app-router
Source: https://github.com/ENG-BXI/SAAS-SMART-SHIPMENT-TRACKING-CLIENT-SIDE/tree/main/.agents/skills/next-intl-app-router
Command: npx skills add https://github.com/ENG-BXI/SAAS-SMART-SHIPMENT-TRACKING-CLIENT-SIDE --skill next-intl-app-router-eng-bxi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill solves the challenge of adding reliable internationalization to a Next.js App Router app, including locale-prefixed URLs and correct translation loading on both server and client.

Core Features & Use Cases

  • Locale-based routing with prefix: Configures next-intl routing so users can navigate to pages like /en/about and /ja/about.
  • Message and request wiring: Loads the correct locale messages dynamically from a per-locale messages directory and sets request locale at the right lifecycle points.
  • Navigation and middleware/proxy support: Provides a locale-aware Link/navigation layer and the middleware/proxy configuration needed for routing to work consistently.

Quick Start

Configure next-intl by copying the example next.config.ts plugin wrapper, creating src/i18n/routing.ts, setting up src/i18n/request.ts to load messages/${locale}.json, and wiring app/[locale]/layout.tsx to use NextIntlClientProvider with getMessages.

Frequently Asked Questions about next-intl-app-router

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

FAQPage Schema
How do I add locale-prefixed routing and translations in a Next.js App Router app?

To add locale-prefixed routing and translations in a Next.js App Router app, configure next-intl by wrapping your next.config.ts with createNextIntlPlugin, defining locales in routing.ts, and wiring NextIntlClientProvider into your layout. This setup enables navigation to paths like /en/about and /ja/about with dynamic message loading.

How does next-intl handle dynamic message loading for server and client components?

Dynamic message loading for server and client components works by setting the request locale at the correct lifecycle points using setRequestLocale and loading per-locale JSON files. The layout then integrates NextIntlClientProvider with getMessages to ensure correct translation usage across the application.

Do I need middleware to set up i18n routing with next-intl in Next.js?

Yes, middleware is required for next-intl i18n routing to work consistently. The setup involves configuring a middleware/proxy layer that handles locale detection and routing, ensuring users are directed to the correct locale-prefixed URLs across the application.

What is the correct setup order for setRequestLocale in Next.js internationalization?

The correct setup order for setRequestLocale requires calling it at the right lifecycle points within your Next.js layout or page components. This ordering ensures that the server-side request locale is established before rendering, enabling accurate translation rendering for internationalized routes.

Can I use next-intl to load locale messages from a per-locale JSON directory?

Yes, you can load locale messages from a per-locale JSON directory by configuring src/i18n/request.ts to fetch messages/${locale}.json. This approach dynamically loads the correct locale messages and supplies them to the application via getMessages.

Why are my next-intl translations not displaying correctly on my Next.js pages?

Translations may not display correctly if setRequestLocale ordering is incorrect or NextIntlClientProvider integration is missing. Ensure your layout uses getMessages to pass translations to the provider and that createNextIntlPlugin properly wraps your next.config.ts file.