i18next/i18next-cli / skills/i18next-localization
i18next-localization
VerifiedTakes an app from hardcoded strings to a localized, continuously translated one with i18next (Locize optional): stack detection, config, wrapping strings in t(), key extraction, Locize sync, and AI translation. Use when the user asks to add or set up i18n, internationalization, localization, translations, or multi-language support, including phrasings like "add i18n", "internationalize my app", "make my app multilingual", "make my app translatable", "localize my app", "find hardcoded strings", "wrap my strings", and library-specific ones like "set up i18next", "add react-i18next", "use next-i18next". Also use when the user names languages they want to support ("I want German and French", "support more languages"), when an app already has i18next but strings are still hardcoded, or when translations need to move to a managed backend. Do not use for translating or reviewing strings in a project whose i18n is already set up.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 7.2 KB |
| references/icu-mf2.md | markdown | 5.1 KB |
| references/stacks.md | markdown | 4.6 KB |
references/stacks.md
View on GitHub# Stack routing
`i18next-cli instrument` parses `.js`, `.jsx`, `.ts`, `.tsx` out of the box.
Other file types (`.vue`, `.svelte`, `.pug`, …) need a plugin in the `plugins`
array of `i18next.config.ts`. Specifying extra extensions in `extract.input` is
**not** enough on its own.
## Plugins
| Stack | Package | Notes |
|---|---|---|
| Vue | [`i18next-cli-vue`](https://github.com/PBK-B/i18next-cli-vue) | Parses `.vue` SFCs. **Community-maintained** |
| Svelte | [`i18next-cli-plugin-svelte`](https://github.com/dreamscached/i18next-cli-plugin-svelte) | Parses `.svelte`. **Community-maintained** |
| Astro | [`i18next-cli-plugin-astro`](https://github.com/i18next/i18next-cli-plugin-astro) | Reads `.astro` for `extract`, `status` and `lint`; does not instrument. **Official** |
| Anything else | write one | Plugin hooks: `instrumentOnLoad` / `onLoad` |
The Vue and Svelte plugins are maintained outside the i18next org, so check they
still support the user's framework version before relying on them.
Add to `i18next.config.ts`:
```ts
import vue from 'i18next-cli-vue'
export default defineConfig({
plugins: [vue()],
// …
})
```
**Without a matching plugin**, `localize` does not fail: it skips the instrument
step with guidance and still runs extract → Locize → auto-translate. So the user
gets a working translation pipeline over whatever keys already exist; only the
automatic wrapping of hardcoded strings is unavailable. Say so rather than
wrapping those files by hand.
## Current setup guides
Verified against the framework versions named. Prefer these over improvising.
| Stack | Approach | Guide |
|---|---|---|
| Next.js App Router | `next-i18next` v16 (`getT()` / `useT()`, middleware locale detection) | [next-i18next-v16](https://www.locize.com/blog/next-i18next-v16) |
| Next.js App Router (manual) | i18next without passing `locale`/`t` around | [i18n-next-app-router](https://www.locize.com/blog/i18n-next-app-router) |
| React Router v7 (framework mode) | `remix-i18next` 7.x, SSR-friendly detection | [react-router-i18next](https://www.locize.com/blog/react-router-i18next) |
| Nuxt 4 | `@nuxtjs/i18n` + vue-i18n, build-time sync via `locize-cli` | [nuxt-i18n](https://www.locize.com/blog/nuxt-i18n) |
| Astro 7 | Built-in i18n routing + plain `i18next` at build time (no JavaScript in the browser) | [astro-i18n](https://www.locize.com/blog/astro-i18n) |
| React (SPA) | `react-i18next` | [react-i18next](https://www.locize.com/blog/react-i18next) |
| Vue (i18next path) | `i18next-vue` | [i18next-vue](https://www.locize.com/blog/i18next-vue) |
| Remix | `remix-i18next` | [remix-i18next](https://www.locize.com/blog/remix-i18next) |
| Side-by-side overview | React / Next / Vue / Angular / Svelte | [javascript-localization](https://www.locize.com/javascript-localization) |
## Guides that are known stale
Tell the user before following these; the concepts hold but the setup does not.
| Stack | Guide | Why |
|---|---|---|
| Svelte | [svelte-i18n](https://www.locize.com/blog/svelte-i18n) | Svelte 3/4 legacy mount API, and covers `svelte-i18n` rather than i18next. For SvelteKit / Svelte 5 use `i18next-cli-plugin-svelte` and wire i18next directly. |
| Angular | [angular-i18next](https://www.locize.com/blog/angular-i18next) | Written for the NgModule era (v12). Check the [angular-i18next repo](https://github.com/i18next/angular-i18next) for current examples. |
## Where Nuxt and Astro differ
- **Nuxt:** the guide uses the framework's own i18n layer (`@nuxtjs/i18n` with
vue-i18n) rather than i18next calls, so `i18next-cli instrument` is not the
tool. Follow the guide instead.
- **Astro:** use plain i18next, no integration package. Astro's built-in
routing gives the URLs (`/en/`, `/de/`); one i18next instance holds the
locale JSON, and each page gets its `t()` from `getFixedT(lang, ns)`. A
static build runs i18next only at build time, so no JavaScript goes to the
browser. Set `interpolation: { escapeValue: false }` (Astro escapes what
`{t(...)}` renders) and write the hreflang links in the layout (Astro's
routing does not add them). `i18next-cli` reads no `.astro` files on its own:
install `i18next-cli-plugin-astro` (dev dependency), add `astro()` to
`plugins` and `astro` to `extract.input` (`src/**/*.{astro,ts}`). Without it,
`status` sees no keys in the pages and reports 100%. With it, make the build
script `i18next-cli status && astro build`, so a missing translation fails
the build. The plugin does not instrument, so `localize` skips that step for
`.astro` files (see "Without a matching plugin" above). When the developer
chose Locize, `locize-cli download` fills the locale folder before each build.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |