Polyglot finds your src/locales layout, merges new keys into it, and wraps call sites with useTranslation — flagging anything it can't wire instead of breaking it.
react-i18next projects keep catalogs in more places than any other ecosystem — public/locales, src/locales, inline resources objects. Polyglot detects the file-based layouts and merges into them; when your dictionaries are inline (nothing on disk to merge into), it flags every string with a fix recipe instead of writing a catalog your app would never load.
"use client";
export default function Page() {
return (
<main>
<h1>Welcome back</h1>
<p>Your projects are ready</p>
<input placeholder="Search projects" />
</main>
);
}"use client";
import { useTranslation } from "react-i18next";
export default function Page() {
const { t } = useTranslation();
return (
<main>
<h1>{t('welcome_back')}</h1>
<p>{t('your_projects_are_ready')}</p>
<input placeholder={t('search_projects')} />
</main>
);
}This fixture keeps catalogs in src/locales/<lng>/<ns>.json — Polyglot found them and merged, preserving existing keys and their order:
{
"existing_key": "Already translated",
"search_projects": "Search projects",
"your_projects_are_ready": "Your projects are ready",
"welcome_back": "Welcome back"
}{
"existing_key": "Bereits übersetzt",
"search_projects": "Search projects",
"your_projects_are_ready": "Your projects are ready",
"welcome_back": "Welcome back"
}Three behaviors you won't get from a find-and-replace script:
t comes from useTranslation('ns', { keyPrefix }) gets keys nested under that prefix, called relatively — resolution-correct at runtime.$ curl -fsSL https://getpolyglot.ai/install.sh | bash
$ polyglot init --framework nextjs
$ polyglot scan
$ polyglot wrap
$ polyglot translate --languages de # 50 strings free, no signupStart in your terminal
Install the CLI, run a scan, and see exactly what you're missing. Free, no account required.