1. Help Center
  2. Supported formats

go-i18n JSON

What is Go i18n JSON format used and how does it differ from JSON files used in other localization platforms.

File Extensions .json
API Extension go_i18n
Import     Yes
Export             Yes
Pluralization support   Yes
Descriptions support No


Go-i18n is an internationalization library designed for Golang. Its supported localization file formats include JSON, YAML, TOML, etc. JSON files used by go-i18n are different from those of other localization/internationalization platforms in that go-18n JSON often exists as a JSON array consisting of a series JSON objects. Each JSON object represents a string that needs translation identified by keys such as “ID”. Phrase provides an integral and easy way to manage and translate go-i18n JSON files.

Code Sample

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

More Information