Translate JSON files

WebTranslateIt supports JSON files as used by the i18next and i18n-node JS libraries, as well as JSONP files.

JSON file example

{
  "error": "A problem occurred.",
  "hello": "Hi",
  "greetings": "Hello there",
  "timeago": {
    "x_days": {
      "one": "1 day ago",
      "other": " days ago"
    },
    "x_seconds": {
      "one": "1 second ago",
      "other": " seconds ago"
    }
  }
}

JSON files containing arrays are also accepted:

{
  "string1": {
    "example": [
      {
        "title": "This is a test!",
        "text": "This is some text."
      },
      {
        "title": "This is a test.",
        "text": "This is some text."
      }
    ]
  }
} 

Plural forms as used by i18next are also accepted:

{
  "ar": {
    "translation": {
      "key": "singular",
      "key_plural_0": "zero",
      "key_plural_2": "two",
      "key_plural_3": "few",
      "key_plural_11": "many",
      "key_plural_100": "plural"
    }
  }
}

i18next-style variables are recognized:

{
    "fr": {
        "ns.1": {
            "pluralTest": "singular",
            "pluralTest_plural": "plural",
            "pluralTestWithCount": "__count__item",
            "pluralTestWithCount_plural": "__count__items"
        }
    }
}

react-intl files are also accepted and parsed in a particular way. Descriptions will be extracted out and displayed as a developer instruction.

{
    "key.confirmation.title": {
        "description": "{variable} Title for that dialog",
        "message": "Hello"
    }
}

Downloading JSON file with JSONP headers

You can download your files using the Show File API endpoint by appending the parameter ?callback=callbackName to the URL.

JSONP file example:

jsonCallback(
{
  "key1": "text1",
  "key2": "text2"
}
);