i18n-nextjs-rules

Configure next-intl internationalization for Next.js App Router projects.

3|Updated Apr 12, 2026
One-click install
npx skills add https://github.com/mauriciodelrio/delriodev-skills --skill i18n-nextjs-rules
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: i18n-nextjs-rules
Source: https://github.com/mauriciodelrio/delriodev-skills/tree/main/es-skills/software/frontend/i18n-nextjs-rules
Command: npx skills add https://github.com/mauriciodelrio/delriodev-skills --skill i18n-nextjs-rules

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides clear, production-oriented guidance to implement internationalization in Next.js App Router projects, removing uncertainty around locale routing, message organization, pluralization, date/number formatting, RTL layout, and middleware-based locale detection.

Core Features & Use Cases

  • next-intl setup: Configure routing, locale list, and re-export typed message bundles for Server and Client Components.
  • Translation APIs: Use useTranslations in components and getTranslations in Server Actions to load scoped messages.
  • ICU MessageFormat & formatting: Use ICU for plurals/select and useFormatter for dates, numbers, currency, relative time and lists.
  • File organization: Split translations by feature for large apps and merge at runtime.
  • RTL & accessibility: Detect RTL locales to set html dir and prefer logical CSS properties to adapt UI.
  • Middleware locale detection: Implement URL → Cookie → Accept-Language → default fallback using next-intl middleware matcher.
  • Use Case: Build a multi-locale storefront that shows localized product counts, currency formatting, and RTL layouts while automatically detecting the user's locale.

Quick Start

Configure next-intl routing and a messages directory, add middleware that detects locale by URL then cookie then Accept-Language with a default fallback, and use useTranslations/getTranslations and useFormatter in your components.

Frequently Asked Questions about i18n-nextjs-rules

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

FAQPage Schema
How do I set up i18n routing with middleware in Next.js App Router?

Next.js App Router i18n routing uses next-intl middleware to detect locales through URL segments, cookies, and Accept-Language headers before falling back to a default locale. This middleware matcher setup ensures seamless locale detection across server and client components.

What is the best way to structure translation files for large Next.js apps?

The best way to structure translation files for large Next.js apps is to split messages by feature and merge them at runtime. Using next-intl, you re-export typed message bundles and load scoped messages within components to keep translation files organized.

How do I handle pluralization and date formatting with ICU MessageFormat in Next.js?

Handle pluralization and date formatting in Next.js using ICU MessageFormat patterns for plurals and selects. The next-intl useFormatter API formats dates, numbers, currency, relative time, and lists within your components.

How do I support RTL layouts in a Next.js App Router project?

Support RTL layouts in Next.js by detecting RTL locales to set the HTML dir attribute and applying logical CSS properties. This adapts your UI layout dynamically for right-to-left languages using next-intl locale data.

Does next-intl work with Server Actions and Server Components in Next.js?

Yes, next-intl works with Server Actions and Server Components in Next.js. You use the getTranslations API in Server Actions to load scoped messages and useTranslations in Client Components for internationalization.

Why is my Next.js middleware locale detection not working?

Middleware locale detection in Next.js may fail if the middleware matcher is not configured correctly. Ensure your next-intl middleware checks the URL, cookie, and Accept-Language headers in the correct order with a proper default fallback.