View as Markdown

Introduction

react-i18next connects i18next to React: useTranslation and Trans in your components, the same translation files and t() as everywhere else.

Set up react-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

What your code looks like

Before:

jsx
<p>Welcome</p>
<p>
  Hello <strong>{name}</strong>, you have {count} unread
  message(s). <Link to="/msgs">Go to messages</Link>.
</p>

After:

jsx
<p>{t('welcome')}</p>
<Trans i18nKey="userMessagesUnread" count={count}>
  Hello <strong>{{ name }}</strong>, you have {{ count }} unread
  messages. <Link to="/msgs">Go to messages</Link>.
</Trans>

With count, the translation file holds one form per plural; see Plurals.

What there is

At least 1,188 of the 100,000 most linked websites run i18next in their own code (scan of 2026-11), many of them React apps: who uses i18next.