IntlPull
Tutorial
12 min read

Next.js Pages Router mit react-intl: Vollständiges i18n-Tutorial 2026

Lernen Sie, wie Sie react-intl mit Next.js Pages Router einrichten. ICU-Nachrichten, IntlProvider, getStaticProps und Sprachwechsel.

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

Lernen Sie, wie Sie react-intl mit Next.js Pages Router einrichten. ICU-Nachrichten, IntlProvider, getStaticProps und Sprachwechsel.

Schnelle Antwort

Um react-intl mit Next.js Pages Router zu verwenden: Installieren Sie react-intl, erstellen Sie ICU-Nachrichtendateien und umwickeln Sie _app.tsx mit IntlProvider.


Installation

Terminal
npm install react-intl

next.config.js:

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

Nachrichten

lang/de.json:

JSON
1{
2  "app.titel": "Willkommen bei Meiner App",
3  "app.items": "{count, plural, =0 {Keine Artikel} one {# Artikel} other {# Artikel}}"
4}

_app.tsx Konfiguration

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}

Verwendung

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

<FormattedMessage id="app.titel" />

Verwandte Artikel

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.