IntlPull
Tutorial
12 min read

Next.js App Router avec react-intl : Tutoriel i18n Complet 2026

Apprenez à configurer react-intl (FormatJS) dans Next.js App Router. IntlProvider, FormattedMessage et changement de langue.

IntlPull Team
IntlPull Team
03 Feb 2026, 11:44 AM [PST]
On this page
Summary

Apprenez à configurer react-intl (FormatJS) dans Next.js App Router. IntlProvider, FormattedMessage et changement de langue.

Réponse Rapide

Pour utiliser react-intl avec Next.js App Router : Installez react-intl, créez des fichiers de messages au format ICU et enveloppez votre app avec IntlProvider.


Configuration

Terminal
npm install react-intl @formatjs/intl-localematcher

messages/fr.json:

JSON
1{
2  "home.titre": "Bienvenue dans notre application",
3  "home.items": "{count, plural, =0 {Aucun article} one {# article} other {# articles}}"
4}

IntlProvider

TSX
1'use client';
2import { IntlProvider } from 'react-intl';
3
4export function IntlClientProvider({ locale, messages, children }) {
5  return (
6    <IntlProvider locale={locale} messages={messages}>
7      {children}
8    </IntlProvider>
9  );
10}

Utilisation

TSX
1import { FormattedMessage, FormattedNumber } from 'react-intl';
2
3<FormattedMessage id="home.titre" />
4<FormattedNumber value={1234.56} style="currency" currency="EUR" />

Articles Connexes

Tags
next.js
react-intl
app-router
i18n
tutorial
formatjs
2026
IntlPull Team
IntlPull Team
Engineering

Building tools to help teams ship products globally. Follow us for more insights on localization and i18n.