View as Markdown

Introduction

i18next shows the texts of a JavaScript app or site in each user's language. Every text sits in a plain JSON file in your repository, and your code fetches it by its key with t().

Set up i18next with your coding agent
Paste this prompt into Claude Code, Cursor, Codex, GitHub Copilot, Gemini CLI or any agent that can run terminal commands:

Prompt
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.

The official i18next-cli prints the steps for the version installed in your project: wrap hardcoded strings in t(), extract the keys, check every language. You review the diff, and the translation files stay in your repository unless you choose a translation management service.
⇒ What the prompt tells your agent

One library, everywhere

The same translation files, the same format and the same t() work in React, Next.js, Astro, React Native, Node.js and Vue. A text translated once serves your app, your site and your mobile app.

At least 1,188 of the 100,000 most linked websites run i18next in their own code (scan of 2026-11), from X, NBA and DeepL to Lufthansa, Strava and UEFA: who uses i18next.

What there is

  • Write translations: interpolation, plurals, context, formatting and nesting.
  • TypeScript: typed keys, so a typo fails at compile time and your editor completes the keys.
  • How it works: namespaces, loading translations, fallbacks and plugins.
  • React, Next.js and Astro: documented here by the i18next team; more frameworks from the team and the community under other frameworks and languages.
  • i18next-cli: the tool your agent calls and your CI runs: extract the keys, report missing translations, lint.
  • Formats: i18next's own format, MessageFormat (ICU) and MessageFormat 2, and other syntaxes and file formats.