IntlPull
Tutorial
12 min read

Next.js Pages Router con react-intl: Tutorial Completo i18n 2026

Aprende a configurar react-intl con Next.js Pages Router. Mensajes ICU, IntlProvider, getStaticProps y cambio de idioma.

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

Aprende a configurar react-intl con Next.js Pages Router. Mensajes ICU, IntlProvider, getStaticProps y cambio de idioma.

Respuesta Rápida

Para usar react-intl con Next.js Pages Router: Instala react-intl, crea archivos de mensajes ICU y envuelve _app.tsx con IntlProvider.


Instalación

Terminal
npm install react-intl

next.config.js:

JavaScript
1module.exports = {
2  i18n: {
3    locales: ['es', 'en', 'fr'],
4    defaultLocale: 'es',
5  },
6};

Mensajes

lang/es.json:

JSON
1{
2  "app.titulo": "Bienvenido a Mi App",
3  "app.items": "{count, plural, =0 {Sin artículos} one {# artículo} other {# artículos}}"
4}

Configuración _app.tsx

TSX
1import { IntlProvider } from 'react-intl';
2import { useRouter } from 'next/router';
3
4export default function App({ Component, pageProps }) {
5  const { locale } = useRouter();
6  return (
7    <IntlProvider locale={locale} messages={pageProps.messages}>
8      <Component {...pageProps} />
9    </IntlProvider>
10  );
11}

Uso

TSX
import { FormattedMessage } from 'react-intl';

<FormattedMessage id="app.titulo" />

Artículos Relacionados

Tags
next.js
react-intl
pages-router
i18n
tutorial
icu
2026
IntlPull Team
IntlPull Team
Engineering

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