On this page
Best practices
What to check before your app goes live with Locize, and what keeps a project in good shape afterwards.
For your coding agent, the Locize plugin brings the skills that set up i18next (i18next-localization), connect the translation files your app already has (locize-sync-translation-files) and set up Locize by the rules on this page (locize-best-practices), the conventions for translating with your glossary and style guide (locize-translation-conventions), and the MCP server. The MCP server acts with your rights: its tools can change, delete and publish translations in your projects. Your project role and the token's scopes limit what it can do.
In Claude Code, add the marketplace, then install the plugin:
/plugin marketplace add locize/locize-agents/plugin install locize@locizeOther agents: locize/locize-agents.
1. Keys only on a server or in CI
An API key or a personal access token in your app's code is visible to every visitor. If it can write, anyone can change your translations. Your app does not need one: it loads public versions from the CDN with the project ID only. A private version is downloaded with a key, so on your server.
Build tools copy some environment variables into the code every visitor downloads, chosen by their name:
| Build tool | Variables that reach the browser |
|---|---|
| Vite (React, Vue, Svelte, …) | VITE_* |
| Next.js | NEXT_PUBLIC_* |
| Astro, SvelteKit | PUBLIC_* |
| Nuxt | NUXT_PUBLIC_* |
| Create React App | REACT_APP_* |
So never give a key such a name in an environment file that a production build reads. Keep it in a variable without the public prefix, and use it only on your server, in build scripts or in CI.
Then search your build output. API keys start with lz_api_ and personal access tokens with lz_pat_:
grep -rE "lz_(api|pat)_" dist/No result means no key with these prefixes in the bundle. A key created before the lz_api_ prefix is a plain UUID: search for the key itself. Use your build's output folder instead of dist/, for example build/ or .next/static/.
If a key has leaked, delete it in your project's settings and create a new one. If a personal access token has leaked, revoke it under Profile › Access tokens.
2. Keep each key narrow
- The smallest role:
read onlywhere the key only downloads,userwhere it writes translations; such a key can also delete and rename namespaces and copy and publish versions.adminonly where it adds or removes languages or versions, works with workspaces or tenants, or invites members. - Only the versions it needs, for example only the version your CI publishes.
- Allowed IP addresses: limit a key to your server or your CI. A list of allowed origins does not protect a key: whoever has the key sets the
Originheader themselves. - Rotate keys: create a new key, deploy it, then delete the old one.
3. saveMissing in development only
saveMissing sends keys your code uses but Locize does not have yet. It needs a key that writes, so it belongs in development, where the key stays on your machine. In production every visitor's browser would need that key (rule 1).
If you use it, keep Auto publish on for that version, and on the Standard CDN set noCache: true in the backend (set for you when debug is on). Otherwise your app loads a file without the keys it already sent, on the Standard CDN an hour old at most, sends them again, and Locize answers with a 412 error ("nothing was missing").
4. Deliver through the CDN
- A version for production: your app loads a version you publish on purpose, not
latest, which by default publishes every change. - Caching on that version keeps load times short. See Caching.
5. Switch backups on
A backup is your way back when content was deleted or overwritten. It runs only once the project has a backup plan, chosen in the project's add-ons on your organization. From Professional on, the standard backup is included. On Starter, Starter Plus and Growth, it is an add-on you pay for. The Free plan has no backups. The schedule is set in the project's settings. See Backups.
6. Remove unused keys
Unused keys cost words, review and attention. Remove them from your code's point of view: npx i18next-cli extract drops the keys your code no longer uses from your translation files (keep dynamic keys with preservePatterns; see i18next-cli). locize sync then deletes them in Locize as well, unless you pass --skip-delete true (CLI).
Where your code does not show every key, for example with several apps on one project, report usage instead: locize-lastused, on development or staging (by default only on localhost), records when a key was last used. The editor's Last used filter then lists the keys not used for a while (search and filters), and issue 303 flags a key unused for a year when you run the issue checks. A key never reported counts as unknown, not as unused. locize-lastused needs an API key with the role user in the app's bundle, so run it only on a staging that only your team reaches; anywhere else, rule 1 applies. Allowed origins keeps other websites from using the key, not a script.
7. Give the AI context before it translates
An AI translation is as good as what it knows about your product. Before you translate a language with AI:
- Glossary: your product terms and their approved translations. The terms found in a text go into the AI request, and the result is checked against them.
- Style guide: tone, formality, audience, per language where needed, and the language mapping (
pttopt-BR). - Context: a description for every ambiguous key, such as "Close" or "Post". The AI reads the description and the character limit, not the key name or a screenshot.
- Quality estimation with Review AI workflow: AI translations of low confidence wait as proposals in the review workflow.
- One language first: translate it, let a native speaker check a sample, adjust glossary and style guide, then the other languages.
How AI and machine translation compare, and where AI still needs a person: Using AI + human translations with Locize.
8. Keep confidential texts inside Locize
A text in a project leaves Locize in these ways. For texts that must not leave, check each:
- Publishing: the CDN serves published files to anyone with their URL. Publish such a version privately on the Pro CDN, where a download needs an API key or a personal access token, or keep it unpublished and bundle the files into your app with
locize download --unpublished true(without the CDN), which counts as private downloads and needs Growth or higher. - Machine and AI translation: every provider gets the source text, Locize AI and Locize MT included, and keys nothing else translated go to Google Translate and MyMemory as a last resort (order and failures). Turn automatic translation, AI review and quality estimation off for such texts, or send them only to an OpenAI-compatible endpoint you run, with Locize AI and Locize MT turned off. It must use https and be reachable from the internet: Locize's servers call it, and so does each translator's browser.
- Ordering: a translation order sends the texts to the partner who translates them.
- Slack:
/locize getandfetchshow values, unpublished ones too, to anyone in the connected Slack workspace (Slack). Leave Slack unconnected for such projects. - Your coding agent: what it reads over the MCP server goes to the provider of its model. Don't connect it to such projects.
How Locize stores and encrypts your data, and where: security.