Supported File Types (Strings)

.JSON - i18next / i18nextV4 (Strings)

Content is machine translated from English by Phrase Language AI.

File Extensions

.json

API Extension

i18next / i18next_4

Import

Yes

Export

Yes

Plural forms support

Yes

Description support

No

Format options

nesting

I18next and I18nextV4 are JavaScript libraries that provide easy-to-use localization and internationalization solutions for various environments based on JavaScript. As one of the oldest l10n/i18n libraries, it supports standard i18n library features such as interpolation and plurals and works well with async requests. With proper configuration, it detects browser language settings to automatically load locale-specific data.

Like other JavaScript l10n/i18n libraries, i18next and i18nextV4 use JSON format to store translations. Strings pending translation are either placed at the value directly or nested inside of another object (e.g. interpolated values). For translation, ensure that all variables are kept intact.

If using i18nextV4, select the i18next 4 (.json) format when uploading.

Pluralization is handled differently between the two versions. To determine pluralized keys:

  • i18next uses _<number> suffixes; pluralization with 1, 2, 3 or for simple case keyname and keyname_plural.

  • i18nextV4 uses _<plural_suffix> endings; pluralization with words one, two, three or for simple case keyname_one and keyname_other.

i18next on GitHub

Supported:

  • Pluralizations

    • Keys ending in _0, _1, _other etc. will be mapped to the according plural forms.

  • Namespaces

  • Arrays

Not supported:

  • Interval Pluralizations are persisted as normal key values. There is no support in the UI.

  • Nesting / Variable replacement is not directly supported but placeholders can be activated. Cross-referencing keys from within values is not supported. There is no support in the UI.

Format Options

Identifier

nesting

Type

boolean

Upload

No

Download

Yes

Default

true

Description

When exporting translation files, keys are nested based on dots in the key name. Set to false to export translation files in flat JSON format.

Code Sample

{
  "boolean_key": "--- true\n",
  "empty_string_translation": "",
  "key_with_description": "Check it out! This key has a description! (At least in some formats)",
  "key_with_line-break": "This translations contains\na line-break.",
  "nested": {
    "deeply": {
      "key": "Wow, this key is nested even deeper."
    },
    "key": "This key is nested inside a namespace."
  },
  "null_translation": "",
  "sample_collection": [
    "first item",
    "second item",
    "third item"
  ],
  "simple_key": "Just a simple key with a simple message.",
  "unverified_key": "This translation is not yet verified and waits for it. (In some formats we also export this status)",
  "pluralized_key_one": "Only one pluralization found.",
  "pluralized_key_other": "Wow, you have %s pluralizations!"
}

Plurals for JSON files

The most common format of plural key messages on various libraries:

"messages": {
    "one": "One message received.",
    "other": "%s messages received.",
    "zero": "No messages received."
}

i18next on GitHub

Was this article helpful?

Sorry about that! In what way was it not helpful?

The article didn’t address my problem.
I couldn’t understand the article.
The feature doesn’t do what I need.
Other reason.

Note that feedback is provided anonymously so we aren't able to reply to questions.
If you'd like to ask a question, submit a request to our Support team.
Thank you for your feedback.