Skip to content
On this page

Languages and namespaces

A project holds its texts in three dimensions: each version has its languages and namespaces, and each pair of a language and a namespace is one file your app loads, for example en/common. A change to a language or a namespace reaches beyond the version you see: other versions, tenants, workspaces, published files and your app.

In the dashboard, changing languages or namespaces needs an admin or manager without a version, language or namespace restriction. An API key with write access also adds, renames and deletes namespaces (saveMissing and locize sync add them); an admin API key adds and removes languages.

Changing the source language

The source language is the one your team translates from; the integrations call it the reference language (referenceLng in i18next-locize-backend, --reference-language in the CLI). Changing it applies to all versions and changes no value: the previous source language becomes a target language, and you can switch back at any time. A workspace keeps its source language.

Inside Locize, everything is measured against the new source language:

  • Progress: the new source language counts as complete, every other language against its keys. A key it has no value for is flagged with issue 301 and no longer counts as to be translated, so complete the new source language before you switch.
  • Checks and issues, machine translation and the translation memory in the editor, and translation orders.
  • Automatic translation starts only for keys created in the source language, so keys added in the previous one no longer trigger it.
  • Members restricted to certain languages can always read the source language; adding and removing keys needs it in their restriction.
  • Your webhooks receive referenceLanguageChanged.

In your integration:

  • saveMissing: i18next-locize-backend reads the source language from the project and sends missing keys only while your app runs in it. The default values in your code become source texts, so write them in the new source language from then on.
  • fallbackLng follows the change only if your app takes its options from the backend (getOptions()); a value you set yourself stays.
  • locize-cli and the GitHub Action: locize sync treats the local files of the new source language as the source of truth and, by default, reads only those. Adapt your repository before the next sync.
  • What only reads translations, such as loading from the CDN or locize download, is unaffected: the files and their URLs stay the same.

Renaming a language

Renaming changes a language's code, for example nn to nb-NO or de to de-DE, without recreating the language. It applies to one version or to all versions.

What follows the new code:

  • The values, with their history and review data. Tags and needs-review marks stay.
  • The published files: the old code's files leave the CDN. A version that publishes automatically publishes under the new code right away; any other version at its next publish.
  • The project's members, invitations and API keys restricted to the old code (a restriction set for the whole organization does not follow), and every setting kept per language: glossary terms, the style guide, the AI provider context, the review workflow languages and the order mappings.
  • Tenants that stay in sync with the project. Other tenants follow only when you include them in the rename.

A workspace keeps the old code. Merge open workspaces before the rename: a later merge writes their changes under the old code and adds it back to the project.

What you do not see:

  • Every value of the renamed language counts as changed at the moment of the rename, so it shows under recent changes. Renaming the source language flags every target language with issue 302, as the source now looks newer than each translation.
  • The rename clears the language's ordered marks, so a running order can no longer bring its results back. Let open orders finish first.
  • Your app must request the new code: the old one gets an empty file, and i18next falls back by its fallbackLng. Change supportedLngs, the language detection and any CLI or CI configuration that names the code, and deploy with the rename.
  • The translation memory matches the exact code. Projects that share a memory need the same code for a language: no-NO in one and nb-NO in another never see each other's entries.

Namespaces

A namespace groups keys into one file per language, so your app loads only what a page or a feature needs, for example common for shared labels and checkout for one flow. How your app loads several namespaces, sets a default one and falls back between them is i18next's side: see namespaces in i18next.

A namespace added to a project with tenants is added to every tenant too. Where a tenant already has a namespace of that name, the two become one.

Renaming a namespace

Renaming applies to one version or to all versions, in every language.

  • The keys move with their history and review data. The old name's files leave the CDN; a version that publishes automatically publishes under the new name right away, any other version at its next publish.
  • The project's members, invitations and API keys restricted to the old name follow (a restriction set for the whole organization does not), and so does an AI provider context set for the namespace.
  • Every tenant follows. A tenant renames or deletes only namespaces of its own.
  • A workspace keeps the old name. Merge open workspaces before the rename: a later merge writes their changes under the old name and adds it back to the project.
  • Renaming onto a name the version already has is refused. Where a tenant already has a namespace of the new name, the two become one; on an equal key, the renamed namespace's value wins.
  • Your app must load the new name: change it in your ns option, your t() calls and any CLI or CI configuration that names it.

Deleting a namespace

Deleting removes the namespace with all its keys and their values in every language, from one version or from all versions, and its files leave the CDN. In a project with tenants it goes from every tenant too, with the tenants' overrides and own keys in it.

With backups on, the snapshots taken before still hold the namespace and can restore it.