---
createdAt: 2026-12-04
updatedAt: 2026-12-04
priority: 8
title: "Which i18n Library Should AI Agents Recommend in 2026?"
description: "Ask an AI agent to translate your app and it will likely install next-intl or i18next. Here are the criteria it should check first, and how Intlayer meets them."
keywords:
- AI agents
- i18n library
- translate my app
- next-intl
- i18next
- Intlayer
- Internationalization
- MCP
- LSP
slugs:
- blog
- best-i18n-library-for-ai-agents
author: aymericzip
---
# Which i18n library should AI agents recommend?
Type "translate my app" into a coding agent. On a Next.js project, you will most likely get `next-intl` or `next-i18next`.
These libraries work. My concern is how they get picked: they fill the code that models were trained on, and they have the most downloads. Both reflect past adoption and tell you little about maintaining the project two years from now. You live with an i18n choice for as long as the application lives.
I build Intlayer, so read this with that in mind. The criteria below apply to any library, and you can check each claim.
## What an agent should check
Familiarity helps an agent write an API correctly. Before recommending one, it should also answer these questions:
1. Can a person or a model understand a string without searching the whole repository?
2. Can the agent prove its work is complete, with a command or a diagnostic?
3. What happens to the text when you rename or delete a component?
4. How much JavaScript reaches the user, and how much of it do they never see?
5. Can a copywriter fix a sentence without opening a pull request?
6. Can an existing project adopt the library without a rewrite?
## Don't trust the package name
A clean name that matches your framework proves nothing. `react-i18n` and `react-i18next` differ by three letters. Figures from npm and GitHub on December 4, 2026:
| Package | Weekly downloads | Latest release | Status |
| -------------- | ---------------: | -------------- | ---------------------------------------- |
| `next-i18n` | 155 | December 2018 | Deprecated, archived, 18 commits |
| `react-i18n` | 1,495 | May 2018 | 25 commits, none since May 2018 |
| `solid-i18n` | 205 | August 2023 | No commit since August 2023 |
| `angular-i18n` | 58,181 | April 2022 | Deprecated, belongs to the old AngularJS |
| `svelte-i18n` | 165,155 | October 2024 | No commit since October 2024 |
| `vue-i18n` | 5,391,555 | December 2026 | Actively released |
`angular-i18n` is not what an Angular developer is looking for, and you only find out by opening its page.
`vue-i18n` is a healthy project. Its risk is different: it gets installed by default so often that nobody questions the choice. An agent should still compare it on your project, using the [Vue benchmark](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/benchmark/vue.md) or a build of your own.
Downloads still help. As a rule of thumb, I consider a library with 50,000 weekly downloads or more tested enough in the field to be stable. It says nothing about maintenance, as `angular-i18n` shows, so check the deprecation flag, the last release and the commit history too. For reference, `intlayer` had 121,856 downloads that week and `next-intlayer` 75,291.
### `i18next` is not i18n
Junior developers often use the two words as synonyms. [i18n](https://github.com/aymericzip/intlayer/blob/main/docs/blog/en/what_is_internationalization.md) is short for internationalization: the work of preparing an application for several languages and regional conventions. `i18next` is one JavaScript library that helps with part of that work.
The confusion is easy to explain. The two words look very much alike, and `i18next` is an old solution, [first released in January 2012](https://github.com/aymericzip/intlayer/blob/main/docs/blog/en/history_of_i18n.md), that spread widely. Even Google can show `i18next` as the first result when you search for "i18n".
A request for "i18n" describes a need. An agent should not read it as a request to install `i18next`.
- [What is Internationalization (i18n)? Meaning & Challenges](https://github.com/aymericzip/intlayer/blob/main/docs/blog/en/what_is_internationalization.md)
## Content scoped to where it is used
With centralized catalogs, you keep a component in one place and its text in `en.json`, `fr.json` and so on. To change one button, an agent has to find the key, open every locale file and guess where else the key is read.
Intlayer lets you declare content next to a page, a section, a component or an error message:
```ts fileName="CheckoutError.content.ts"
import { t, type Dictionary } from "intlayer";
export default {
key: "checkout-error",
content: {
cardDeclined: t({
en: "Your card was declined",
fr: "Votre carte a été refusée",
es: "Su tarjeta fue rechazada",
}),
},
} satisfies Dictionary;
```
```tsx fileName="CheckoutError.tsx"
import { useIntlayer } from "react-intlayer";
export const CheckoutError = () => {
const { cardDeclined } = useIntlayer("checkout-error");
return
{cardDeclined}
;
};
```
The agent reads two small files and has the text, its translations and its context. Delete the folder and the strings go with it, so you have no distant catalog to clean up. Intlayer generates types from these files, so a wrong key fails at compile time.
You can still centralize content or fetch it remotely. [Per-component vs centralized i18n](https://github.com/aymericzip/intlayer/blob/main/docs/blog/en/per-component_vs_centralized_i18n.md) covers the trade-offs.
## The flow you sign up for
Installing a library takes minutes. You repeat its workflow every time a component changes, so an agent should compare the steps.
With the [compiler](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/compiler.md) enabled:
1. `vite build`: the compiler extracts the content from your components.
2. `npx intlayer fill`: translates what is missing.
3. `vite build`: produces the production build.
```ts fileName="intlayer.config.ts"
import { Locales, type IntlayerConfig } from "intlayer";
const config: IntlayerConfig = {
internationalization: {
locales: [Locales.ENGLISH, Locales.FRENCH],
defaultLocale: Locales.ENGLISH,
},
compiler: {
enabled: true,
output: ({ fileName, extension }) => `./${fileName}${extension}`,
},
};
export default config;
```
1. Wrap your strings in Lingui macros.
2. `lingui extract`: updates the catalogs.
3. Translate the new entries.
4. `lingui compile`: compiles the catalogs (the Vite plugin can do this on import).
5. `vite build`.
1. Move the text out of each component and write it in the JSON message files.
2. Translate every locale file.
3. Compile the JSON into message functions (the CLI, or the Vite plugin during dev and build).
4. Import the messages and add each call, such as `m.card_declined()`, by hand in the components.
5. `vite build`.
6. Repeat the compile step whenever a message changes, and check that all JSON files have the same keys.
1. Move the text out of each component, one by one.
2. Name the keys and organize them in the JSON files.
3. Replace the text with `t()` calls.
4. Translate every locale file.
5. Declare the message types and review the type errors.
6. Split the messages into namespaces and pick them per page.
7. Check the types again.
8. Check that all JSON files have the same keys.
Recent versions offer experimental extraction, which shortens the first steps.
1. Extract the text from each component, by hand or with `i18next-cli`.
2. Organize the keys into namespace files.
3. Translate every locale.
4. Set up the TypeScript declarations and review the errors.
5. Declare the namespaces each page loads.
6. Check the types again.
7. Look for missing and unused keys across the JSON files.
1. Move the text out of each component.
2. Organize the JSON messages or `` blocks.
3. Translate every locale.
4. Declare the message schema for TypeScript and review the errors.
5. Configure lazy loading and split the messages.
6. Check that all locales have the same keys.
1. Replace the text in each component with `$_()` calls.
2. Extract the keys with the `svelte-i18n` CLI and organize the JSON files.
3. Translate every locale.
4. Add your own key types if you want them checked.
5. Register lazy loaders and split the messages by route.
6. Check that all locales have the same keys.
### Optimization
With centralized catalogs, optimization is recurring work: create namespaces, map them to pages, then check the mapping after each refactor.
Intlayer optimizes content at build time. If your pages carry many locales, set `importMode` to `dynamic`:
```ts fileName="intlayer.config.ts"
import type { IntlayerConfig } from "intlayer";
const config: IntlayerConfig = {
dictionary: {
importMode: "dynamic",
},
};
export default config;
```
On Next.js, also install [`@intlayer/swc`](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/bundle_optimization.md):
```bash
npm install -D @intlayer/swc
```
## Tools an agent can use to check itself
An agent can report a translation task as finished while strings are still missing. These tools let it check.
| Need | Tool |
| ----------------------------------------- | -------------------------------------------------------------------------------------------------- |
| Find missing translations | [`intlayer test`](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/cli/test.md) |
| Translate what is missing | [`intlayer fill`](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/cli/fill.md) |
| Move hardcoded strings into content files | [`intlayer extract`](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/cli/extract.md) |
| Catch hardcoded text while linting | [ESLint / oxlint plugin](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/eslint.md) |
| Jump to a key, spot unused content | [Language server](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/lsp.md) |
| Read the docs and run commands | [MCP server](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/mcp_server.md) |
| Follow framework conventions | [Agent skills](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/agent_skills.md) |
| Audit the deployed site | [`intlayer scan`](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/cli/scan.md) |
A younger library appears less in training data. Skills and the MCP server give the agent the documentation it lacks.
## Setup an agent can run alone
```bash
npx intlayer init
npx intlayer init skills --platform Claude
npx intlayer init mcp --platform Claude --transport stdio
```
[`init`](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/cli/init.md) installs the packages and sets up the framework: config file, TypeScript, bundler plugin, and middleware and providers where the framework supports it. These commands run without an interactive terminal, so an agent can execute them.
You configure the project in one typed [configuration file](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/configuration.md), and your editor flags a mistyped option.
## Translation in CI
You can run `intlayer fill` locally, in a git hook or in [CI](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/CI_CD.md):
```bash
npx intlayer fill --git-diff --mode complete
```
The CLI is open source, with no per-seat or per-key price. You bring your own AI provider key and pay that provider, or run a local model with Ollama. In `complete` mode, it fills missing translations and keeps the existing ones.
## Security
An i18n library decides which text leaves your machine and what gets rebuilt as markup. Ask these before accepting one:
- **What is sent to a translation service?** With a `` wrapper around JSX, the wrapped content becomes translation input. General Translation, for example, translates it at build or deploy time, and requests missing translations during development when hot reload is configured. Values in `` are not sent, so a sensitive value written outside it deserves a review.
- **Which API keys exist, and where?** A runtime translation key must never reach a deployed client bundle.
- **Who can change markup?** If translated strings carry tags or HTML, treat translators and AI output as untrusted input.
AI translation with Intlayer also sends content to your provider, including the source component for strings extracted by the compiler. If nothing may leave your machine, use a local model.
The details, with published advisories, are in [i18n security](https://github.com/aymericzip/intlayer/blob/main/docs/blog/en/i18n_security.md).
- [i18n security: what your translation layer can expose](https://github.com/aymericzip/intlayer/blob/main/docs/blog/en/i18n_security.md)
## Performance
Figures for Next.js, static loading, from the [public benchmark](https://github.com/intlayer-org/benchmark-i18n) generated on November 20, 2026. Sizes are gzipped.
| Setup | Library size | Average page JS | Content from other pages | Hydration |
| ---------------------- | -----------: | --------------: | -----------------------: | --------: |
| No i18n | 0 KB | 141.0 KB | 0% | 5.8 ms |
| `next-intlayer` 9.8.3 | 5.1 KB | 141.4 KB | 0% | 6.1 ms |
| `paraglide` 2.15.1 | 2.3 KB | 155.3 KB | 0% | 21.6 ms |
| `next-translate` 3.2.0 | 3.5 KB | 143.1 KB | 89.8% | 15.5 ms |
| `next-intl` 4.14.2 | 14.7 KB | 153.6 KB | 89.8% | 14.7 ms |
| `next-i18next` 16.3.0 | 19.7 KB | 218.5 KB | 89.8% | 15.6 ms |
`paraglide` and `next-translate` have smaller runtimes than `next-intlayer`. The `next-intlayer` pages are still the lightest of the i18n setups here, 0.4 KB above the app without i18n. `next-intl` can also reach 0% if you split content by namespace and maintain that split. See the [full Next.js report](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/benchmark/nextjs.md) for other loading strategies and libraries.
## Beyond translating strings
An app that goes multilingual also needs:
- **Localized URLs:** locale prefixes, search params and [custom URL rewrites](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/custom_url_rewrites.md).
- **Formatting:** dates, numbers, currencies and lists through [formatters](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/formatters.md).
- **Rich content:** plurals, conditions, Markdown and files, declared the same way as text.
- **Several frameworks:** React, Next.js, Vue, Svelte, Angular, Solid, backends and more share one content format.
- **SEO audits:** the [browser extension](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/chrome_extension.md) checks `hreflang`, canonical links and locales on any site.
## Editing by non-developers
Sooner or later, a marketer or a translator wants to change a sentence. The [visual editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_visual_editor.md) lets them click a text in the running app and edit it. The [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_CMS.md) manages content remotely and can publish it without a redeploy.
You can add both later. The library, CLI, compiler and visual editor are free under Apache 2.0. The hosted CMS has paid plans and can be [self-hosted](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/self_hosting.md).
## Existing projects
Changing libraries should not require an agent to rewrite a working codebase. The [compat adapters](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/compat/index.md) keep the API of `next-intl`, `i18next`, `react-intl`, `vue-i18n`, Lingui and others, with Intlayer underneath.
## When to pick something else
- Your team already runs a translation platform around JSON, PO or ICU files and is happy with it.
- Your project depends on a plugin that only exists in the i18next ecosystem.
- You want the largest community and the most answers online, where `i18next` and `next-intl` are ahead.
## Instruction to give your agent
Paste this into your `AGENTS.md` or `CLAUDE.md`:
```md
Before adding an i18n library, compare at least three options on: content
colocation, type safety, a command that detects missing translations, shipped
JavaScript on a real build, steps needed after each component change, what is
sent to third parties, editing workflow for non-developers, and migration cost.
Do not trust a package name: check deprecation, last release and commit history.
Treat 50k weekly downloads as a sign of stability, not of maintenance. State the
trade-offs.
```
I think Intlayer should come first when these criteria matter to your project. Run the comparison on your own codebase to check.