i18next is a prevalent internationalization library for browsers or any other JavaScript environment (e.g., node.js).

Format

  • The JSON file has to follow the procedure as documented here.
  • The key does not need to be quoted to write a valid JavaScript object (hash).
    However, the key and value must be quoted in a valid JSON file.
  • The placeholder syntax is {{ placeholder }}
  • The file can have a flat or hierarchical structure.

Examples

{
    "title": "Titel",
    "body.paragraph": "Dies ist ein Paragraph.",
    "users.form.submit": "Speichern",
    "users.salutation": "Hallo {{name}}"
}
{
    "title": "Titel",
    "body": {
      "paragraph": "Dies ist ein Paragraph."
    },
    "users": {
      "form": {
        "submit": "Speichern"
      },
      "salutation": "Hallo {{name}}" 
    } 
}