Documentation reviewed 23 November 2026.
Quick answer
Translating a React or Next.js app automatically takes three parts: an i18n library that looks strings up at runtime, a source locale file those strings live in, and a step that translates that file into every other language whenever it changes. The first two are a one-time setup. The third is where tools differ, and it is the part worth automating, because a product that ships weekly changes its strings weekly.
Part 1: an i18n library
The library swaps a key for a string in the current language. The common choices are:
| Library | Fits | Message syntax |
|---|---|---|
| next-intl | Next.js with the App Router | ICU |
| react-i18next | React apps in general, largest ecosystem | i18next, with _one and _other suffix keys |
| FormatJS (react-intl) | Apps that want ICU syntax everywhere | ICU |
Any of them works with any translation tool, because they all read plain locale files, usually JSON.
With next-intl, a component reads a string like this:
With react-i18next the shape is the same:
Part 2: one source file
Put every user-visible string in a source file, with a key per string. For the next-intl component above:
Save it as messages/en.json. Each other language gets a file of the same shape: messages/fr.json, messages/de.json.
Four rules save work later:
- Write whole sentences as one string. Do not build a sentence from fragments, since word order differs by language.
- Use the library's placeholder syntax, never string concatenation.
Hello, {name}!can be reordered by a translator.'Hello, ' + namecannot. - Use real plural syntax. The ICU form above lets each language have the plural forms it needs. Polish and Arabic need more than two.
- Name keys by meaning, not by position.
checkout.pay_buttonsurvives a redesign.page2.button3does not.
i18next best practices covers key naming and namespaces in more depth.
Part 3: the translation step
This is the automatic part. There are three ways to do it.
| Approach | How it works | Fits |
|---|---|---|
| Script and a model API | A script sends changed strings to a model and writes the files | One developer, a few languages |
| A library that also translates | An i18n library with translation built in, for example Lingo.dev or General Translation | Teams that want one package for both |
| Localization platform | A service stores strings, translates on push, and gives reviewers an editor, for example Lokalise, Crowdin, Tolgee or Transglot | Teams where non-developers review |
A script is free and yours to maintain. How to translate JSON i18n files with AI walks through one. A platform costs money and adds review, a glossary, translation memory and checks. Pick by who will read the translations before users do.
If you compare platforms, compare what each one counts. The Lokalise, Crowdin and Tolgee comparisons price the same workload on each.
A working setup with Transglot
1. Connect the repository
From the root of a repository that already has messages/en.json:
init finds the file, works out the source language, signs you in through the browser and runs the first translation. It writes a translated file for each language and a transglot.json:
Commit both. Your i18n library now has the files it expects, with no change to your components.
2. Translate on every push
Create a deploy token with the push and pull abilities in the project, add it as a repository secret named TRANSGLOT_TOKEN, then add .github/workflows/transglot.yml:
On each push to main, the action uploads the strings that changed, waits for the translation, pulls the files and commits them back. Only changed strings are translated, so an unchanged file costs nothing.
3. Know what the checks cover
Every string passes four checks before it is written: placeholders, plural forms, glossary terms and length. A string that fails placeholders, plurals or glossary is repaired once. If it still fails it is refused, and the job fails instead of merging a broken translation.
One detail for JSON: the format has no plural construct of its own. An ICU plural inside a string, as in the example above, is read and checked as a plural. i18next suffix keys such as items_one and items_other are ordinary keys, so a language that needs items_few or items_many needs those keys added. React localization CI checks shows how to catch a missing one in your own pipeline.
The command line tool and the action start on the Starter plan, $19 a month for 300,000 translated words. If the account is on Free, the browser offers a 14-day trial while you connect. See pricing.
Optional: update text without a deploy
By default the translated files live in your repository and ship with your build. If you want a wording fix to reach users without a release, load translations at runtime instead.
For Next.js:
@transglot/next fetches the published translations on the server, so the first render is already translated. It works with the App Router and the Pages Router on Next.js 14 or 15. Keep the CDN key in a server environment variable.
Two other packages cover the rest:
@transglot/react-i18nfor a React app without Next.js.@transglot/i18next-backendif you already use i18next or react-i18next. Yourt()calls stay as they are and only the source of the files changes.
Runtime delivery is on the Starter plan and above. The runtime SDK guide lists every package.
Common mistakes
- Translating keys. A model given raw JSON sometimes translates
"title"as well as its value. Send values only, or use a tool that parses the file. - Hardcoded strings left behind. Text in
aria-label,placeholder,alt, error messages and metadata is easy to miss. Search for them. - Dates, numbers and currency formatted by hand. Use
Intl.DateTimeFormatandIntl.NumberFormat, or your library's formatters, so each language gets its own format. - One layout for every language. German runs about a third longer than English, and Arabic and Hebrew read right to left. Test the longest language and one right-to-left language.
- No language in the URL. Search engines index one URL per language. Use a locale segment such as
/fr/pricingand set thelangattribute on thehtmlelement.
Frequently asked questions
Do I need an i18n library if I use a translation tool?
Yes, in most setups. The tool produces translated files; the library reads them in the browser or on the server. Tools such as Lingo.dev and General Translation are the exception, since they ship their own library.
Will automatic translation break my placeholders?
It can, which is why a check after translation matters. Compare the placeholders of each translated string with its source. Transglot does this on every string and refuses one it cannot repair.
How do I translate only what changed?
Keep a record of what was already translated. A script can store a hash per key. A platform does it for you: pushing an unchanged file translates nothing.
How many languages can I add?
As many as your library and your reviewers can handle. Transglot accepts any standard language tag and its Free plan holds 14 target languages in one project.
Does this work with the Pages Router and with plain React?
Yes. The translation step only reads and writes locale files, so it does not depend on the router or the framework. For runtime delivery, @transglot/next supports both routers and @transglot/react-i18n covers React without Next.js.
How this guide was checked
- Library descriptions follow each project's own documentation, linked under Sources.
- The configuration, workflow and SDK examples are taken from the product documentation on the review date.
- The three approaches in Part 3 are described by how they work, not ranked. A script is the right choice for many small projects, and the guide says so.
- The other platforms named were not tested for this guide, so it makes no claim about which translates best.