Skip to content
On this page

Troubleshooting

When Locize behaves differently than you expect, the cause usually lies in the setup around it: a mail filter, the way an app loads its translations, or a request your code sends. Each section names the symptom, its causes and what to change.

Emails don't arrive

If an invitation, a password reset or a notification from Locize never arrives, or a reply from our support does not, your company's mail server most likely holds it back. Mail filters such as Mimecast, Proofpoint or Microsoft Defender for Office 365 often treat mail sent through a delivery service as suspicious.

Ask your IT team to allow-list Locize by domain, not by IP address: the addresses of the sending service change. Give them these details:

  • Senders: no-reply@locize.app for most emails of the app, support@locize.com for some about your subscription and projects and for our support's replies.
  • Sending service: the app's emails go through Amazon SES in the region eu-west-1 (Ireland), with mail.locize.app and mail.locize.com as the domains that bounces return to. Our support's replies go through Hostpoint, our mail host in Switzerland.

A reply from our support that bounces with the error 5.7.1 ("delivery not authorized") means a rule on your mail server blocks our domain. Forward the error to your IT team: it helps them find the rule.

If your IT team has allow-listed Locize and an email still does not arrive:

  • Check the spam folder.
  • Check the spelling of the address in Locize.
  • Invite an address of another domain, a personal one for example. If it arrives, the block is in your company's network.
  • If your mail server refused an email from Locize before the allow-listing, Locize blocked the account with that address and sends it no more email; signing in says so. Write to support@locize.com from that address to have it unblocked.

High download count

One download is one request for one namespace in one language, through the CDN or the API. An app that loads three namespaces in five languages without a cache makes 15 downloads on every page load. Translations your app serves from its own cache send no request and count nothing. locize download of locize-cli downloads each namespace in each language once per run. What happens when a project goes over its plan: downloads above the plan.

Your project's API metrics show where the downloads come from. Most high counts have one of the causes below.

Serverless functions

A serverless function starts without a cache on each cold start, and each of its parallel instances has its own. With i18next-locize-backend, or a call to the download API, every one of them loads the translations again.

Download the translations in your CI/CD pipeline instead, with locize-cli or the API, and bundle them with the function.

A new i18next instance per request

An i18next instance downloads its namespaces when it starts. A server that creates an instance per request downloads them on every request, unless i18next-locize-backend may cache the response: it keeps it in the server process for the CDN's cache time (one hour on the Standard CDN, the version's cache time on the Pro CDN). With a short or no cache time, your download count follows your traffic. Server-side rendering counts as well: a component that initializes i18next does so on the server too, once per render.

On a server, i18next-locize-backend also reloads an instance's namespaces every hour (reloadInterval, on by default where window is undefined). Before version 10.2.0, this timer kept every instance alive until the server restarted. The hourly downloads then grew with each request and dropped only at the next deploy.

  • Create one i18next instance per process and clone it per request.
  • On an instance that lives shorter than the process, set reloadInterval: false.
  • Use i18next-locize-backend 10.2.0 or later.

In the API metrics, server requests appear under i18next-locize-backend in the downloads by browser. If these rise and fall with your server's traffic, this is the cause.

next-i18next

With next-i18next and i18next-locize-backend at runtime, both causes above can apply: a serverless deployment, and instances created per request.

  • App Router: I18nProvider is a Client Component that Next.js also renders on the server, once per request. Before next-i18next 16.0.11, a backend passed to it through use was attached during that server render too, and each render left a reload timer behind. Use 16.0.11 or later.
  • Bundled translations: load them with resourceLoader and dynamic imports, or download them in CI/CD with locize-cli. In a serverless deployment, use i18next-locize-backend on the client only. Details: next-i18next v16.
  • One Locize project per tenant: on the Pages Router, pass the tenant as serverInstanceKey (next-i18next 16.5.0 or later); on the App Router, call createServerI18next once per tenant and keep its result. Each tenant then has one instance per server process, which downloads its namespaces once and reloads them every hour. Take the keys from a fixed list of your tenants, never from a value of the request such as a header: every new key creates an instance that downloads its namespaces and keeps its reload timer until the server stops. See multi-tenant setups.

remix-i18next

With remix-i18next and i18next-locize-backend, the cause is usually a serverless deployment or an instance per request (both above). Bundle the translations on the server:

  • React Router v7 (remix-i18next 7): the server reads the translations from bundled JSON files, the browser loads current ones from the Locize CDN. See React Router and i18next and the example.
  • Remix v2 (remix-i18next 6): see the example.

A mobile app loading from the CDN

A mobile app that loads its translations from the CDN on every start downloads them on every device. Download the translations when you build the app, with locize-cli or the API, and bundle them with it. To still get changes without a release, cache them on the device with an expiry, so the app loads from the CDN at most once per period (Cache and fallback on i18next.com). The bundled copy stays the fallback.

Unnecessary or unauthorized requests

Your project's API metrics count two kinds of requests that write nothing: unnecessary and unauthorized ones. Both come from an app or a tool that reports missing keys (saveMissing) or sends updates where it should not.

Unnecessary requests reach Locize with nothing to do: a missing key that already exists, or an update whose value is already stored. Locize answers with the status 412. Common causes:

  • saveMissing is on where the translations are complete, so every start of your app reports the same keys again.
  • The version publishes manually, or on the Standard CDN noCache is off, so the CDN and the browser keep a file for up to an hour. The CDN then lacks the keys your app already sent, and your app sends them again (rule 3).
  • react-i18next renders before the translations have loaded, so keys look missing. Wait for them with Suspense, or see "not using Suspense" for the hook and the HOC.

Unauthorized requests carry an API key that may not write, or a missing or invalid key. Locize answers with the status 401 and writes nothing. Common causes: a deleted or rotated key, a key of another project, or a key restricted to other languages, namespaces or versions.

Both counts stay at zero with the setup of the best practices: saveMissing and updates only in development, with a key that stays on your machine, and the CDN in production, which only reads.

"The passed json is nested too deeply"

The Locize API answers a request that adds or updates keys with the status 400 and "Body not valid! The passed json is nested too deeply." when its body is nested, or when a key's object holds another field or value than those below. The API takes flat JSON: one entry per key, with the key's path written in dots.

Nested, refused:

json
{
  "new": { "key": "default value" },
  "another": { "existing": { "key": "changed value" } }
}

Flat, accepted:

json
{
  "new.key": "default value",
  "another.existing.key": "changed value"
}

A key's entry may be an object instead of a text, with these fields only:

  • value: the text.
  • context: the description for translators, as { "text": "…" }.
  • tags: the key's tags.
  • quality: where the translation comes from, HT (a person), TM, MT or AI.
  • needsReview: true or false.
json
{
  "new.key": {
    "value": "default value",
    "context": { "text": "Button label on the checkout page" }
  }
}

An array of texts is accepted as well: "steps": ["one", "two"] becomes the keys steps.0 and steps.1. Any other nesting is refused. All endpoints: API reference.

Asking support

If nothing here helps, write to support@locize.com from the address you sign in with. Name the project and what you did and saw; for the CLI or an SDK, add the command, its version and the error text. Never send an API key. We usually answer within one working day (Swiss time).