Structured JSON
Dmitry Olenovs avatar
Written by Dmitry Olenovs
Updated over a week ago

You might also be interested in checking out our JSON localization tutorial (aimed towards web devs).

Lokalise supports structured JSON files

Structured JSON file entries can contain the following properties:

  • translation  – the actual translation (required)

  • notes – description of the key (optional)

  • context – context of the key (optional)

  • limit – character limit for the key (optional)

  • tags – additional tags (optional)

Example

{
    "mm_homepage": {
        "translation": "Homepage",
        "notes": "Title for main menu",
"tags": [ "main", "important" ]
    },
    "mm_about": {
        "translation": "About us",
        "notes": "Title for main menu",
        "limit": 20
    },
    "somekey": {
        "translation": "First level key"
    },
    "somekey::sub": {
        "translation": "Second level key"
    }
}

If you are using TypeScript and want to add autocompletion feature for your key names, you can add the following line of code to your app:

keyof typeof import ('./path/to/some/json/file.json')
Did this answer your question?