JSON

Quite a lot of JavaScript libraries or frameworks exist for localizing an application.
Therefore, we have defined a standard JSON format.

Format

  • The JSON format is used.
  • The key must not 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 (see examples below).
  • comments for segments can be added in the format
    _<key of the associated segment>.comment=…

Lingohints can be used by being included in a comment:

{
    "title": "Title",
    "_title.comment": "<lh>{\"status\": \"TRANSLATED\",\"qc\": {\"min\": \"3\",\"max\": \"20\"},\"labels\": [\"q3-2024\"],\"not_translatable\": false}</lh>"
}  

Used by

Examples

Additional example files can be accessed here.

{
    "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}}" 
    } 
}

References