In addition to flat JSON files, Lokalise supports nested JSONs with unlimited depth:

{
  "main": {
    "username": "User name",
    "password": "Enter password",
    "app": "Lokalise"
  }
}

Seperator

Colon (:) is used as seperator for nested JSON keys.

When adding new key via web interface, use :: to refer JSON levels, for example main::username.

The third colon (:::) is used to indicate that number used in key name must be interpreted as string. See examples below.

Examples

Import example for array:

{
  "main": [
    "Item 1",
    "item 2",
    "Item 3"
  ]
}

Created keys:

main::0
main::1
main::2

To be able to export the as array you must maintain correct key name order. If any of elements will be missing then these keys will be exported inside object.

Export example with one key missing (main::1 was deleted in this case):

{
    "main": {
        "0": "Item 1",
        "2": "Item 2"
    }
}

As you can notice that it's no longer an array. Now it's exported as object because keys are not numbered in correct order.

Three colon (:::) example keys.

main:::0
main:::1
main:::2

Export example using three colons (:::) in key names:

{
    "main": {
        "0": "Item 1",
        "1": "Item 2",
        "2": "Item 3"
    }
}
Did this answer your question?