IntlPull
Tutorial
14 min read

Next.js Pages Router mit next-i18next: Vollständiges i18n-Tutorial 2026

Vollständige Anleitung zur Einrichtung von next-i18next in Next.js Pages Router. Konfiguration, serverSideTranslations und Namespace-Verwaltung.

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

Vollständige Anleitung zur Einrichtung von next-i18next in Next.js Pages Router. Konfiguration, serverSideTranslations und Namespace-Verwaltung.

Schnelle Antwort

Um next-i18next zu verwenden: Installieren Sie das Paket, erstellen Sie next-i18next.config.js, umwickeln Sie _app.tsx mit appWithTranslation und verwenden Sie serverSideTranslations.


Installation

Terminal
npm install next-i18next react-i18next i18next

Konfiguration

next-i18next.config.js:

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

Übersetzungen

public/locales/de/common.json:

JSON
1{
2  "begruessung": "Hallo, {{name}}!",
3  "items_one": "{{count}} Artikel",
4  "items_other": "{{count}} Artikel"
5}

Verwendung

TSX
1import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
2import { useTranslation } from 'next-i18next';
3
4export default function Startseite() {
5  const { t } = useTranslation('common');
6  return <h1>{t('begruessung', { name: 'Welt' })}</h1>;
7}
8
9export const getStaticProps = async ({ locale }) => ({
10  props: {
11    ...(await serverSideTranslations(locale, ['common'])),
12  },
13});

Verwandte Artikel

Tags
next.js
next-i18next
pages-router
i18n
tutorial
ssr
2026
IntlPull Team
IntlPull Team
Engineering

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