i18next/next-i18next
Über uns
Die einfachste Möglichkeit, deine NextJs-Apps zu übersetzen.
Web- und App-EntwicklungGemessener Sternzuwachs
- in 24h
- 0
- in 7 days
- +2
- in 15 days
- +3
- in 1 month
- +2
Nettoänderungen in überlappenden Zeiträumen, keine Tagessummen. Fehlende Messwerte bleiben leer. Sterne zeigen Interesse, nicht Qualität.
README.md
Originalnext-i18next
The easiest way to translate your Next.js apps.
Supports the App Router (Server Components, Client Components, the proxy), the Pages Router, and mixed setups where both routers coexist.
If you already know i18next: next-i18next v16 is a thin layer on top of i18next and react-i18next that handles the Next.js-specific wiring (the proxy, the server/client split, handing the translations to the browser), so you don't have to.
Documentation: www.i18next.com/next
Advice:
If you don't like to manage your translation files manually or are simply looking for a better management solution, take a look at i18next-locize-backend. The i18next backend plugin for 🌐 Locize ☁️ — built by the same team behind next-i18next, with CDN delivery (works great on Vercel/serverless), AI translation, and no redeploys for copy changes.
Starting from a Next.js app with hardcoded strings? Run npx i18next-cli localize: one command that wraps strings in t() (since i18next-cli 1.90 with await getT() in Server Components and useT() in Client Components; review the diff and the warnings), extracts keys, connects to Locize and AI-translates your app. See the launch post.
Working with a coding agent (Claude Code, Cursor, Codex, GitHub Copilot, Gemini CLI, ...)? Paste this prompt; the CLI prints the steps for its installed version, you review the diff, and the translation files stay in your repository unless you choose otherwise (what the prompt tells your agent):
Localize this app with i18next.
Run `npx i18next-cli localize --print-agent-prompt` and follow
the steps it prints, in order, checking each one before the next.
Install
npm install next-i18next i18next react-i18next
Where to start
- A new App Router app: App Router setup: the translation files,
i18n.config.ts, the proxy, a server module withcreateServerI18next, the root layout, thengetT()in Server Components anduseT()in Client Components. Then choose how the language shows in the address: in the path (/de/about, the default), without a prefix for the default language, only in a cookie, or clean addresses that still prerender. - An app on the Pages Router: Pages Router setup.
- Both routers in one app: Mixed routers.
- Coming from v15: Migration from v15.
- Complete projects: the examples below.
i18next-locize-backend
To load the translations from Locize, the translation management service by the i18next maintainers, add i18next-locize-backend to use in your config:
import { defineConfig } from 'next-i18next'
import LocizeBackend from 'i18next-locize-backend'
export default defineConfig({
supportedLngs: ['en', 'de'],
fallbackLng: 'en',
use: [LocizeBackend],
i18nextOptions: {
backend: {
projectId: 'your-project-id',
apiKey: 'your-api-key', // only needed for saving missing keys
},
},
})
The apiKey is only needed to save missing keys: put it into development builds, never into production. Everything else works as with any i18next backend: Custom backends shows the server config, the backend for I18nProvider in the browser, and why backends stay out of the server render.
Moved to www.i18next.com
The sections that were in this README are pages of the documentation now:
Examples
| Example | Description |
|---|---|
app-router-simple |
App Router with locale-in-path (/en/...) |
app-router-no-locale-path |
App Router with cookie-based language (no locale in URL) |
app-router-icu |
App Router with ICU MessageFormat: plurals, select and rich text in Server and Client Components |
mixed-routers |
App Router + Pages Router in the same project |
pages-router-simple |
Pages Router with getStaticProps / getServerSideProps |
pages-router-ssg |
Pages Router with static export (output: 'export') |
pages-router-auto-static-optimize |
Pages Router with client-side loading via chained backend |
Contributors
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
Gold Sponsors
localization as a service - Locize
Needing a translation management? Want to edit your translations with an InContext Editor? Use the original provided to you by the maintainers of i18next!
Now with a Free plan for small projects! Perfect for hobbyists or getting started.
By using Locize you directly support the future of i18next and next-i18next.
Ähnliche Projekte entdecken
Wird geladen…