Skip to main content
Version: 3.x.x

Tolgee Native JSON

Native JSON is a simple JSON format that is native to Tolgee. In this format, we preserve the ICU message format. This format is native to the Tolgee JavaScript SDKs, and we recommend using it when possible.

Example

This is the most common flat .json example.

en.json
{
"user-settings.password.save.button": "Save",
"interpolated_key": "Hello, {name}!",
"plural_key": "You have {count, plural, one {one message} other {# messages}}."
}

Tolgee native format is simple flat JSON with no nesting or array support. We recommend using this format if you work with Tolgee SDKs because there is no space for confusion as with structured JSON. If you need support for nesting or arrays, go ahead with structured json format.

Format specification

In JSON format, we store data as a JSON object. The keys in the JSON are localization keys, e.g. user-settings.password.save.button, and the values are the translated strings, e.g., Save, as you can see in the example. Keys, including dots or array indexes, are not converted to nested objects.

Exporting via REST API

To export to Tolgee Native JSON via REST API, you have to set the following parameters:

{
"format": "JSON",
"supportArrays": "false",
"structureDelimiter": ""
}

Example with CURL:

curl "https://app.tolgee.io/v2/projects/export?\
format=JSON\
&structureDelimiter=\
&supportArrays=false" -H "X-API-Key: <Your Project API key>" --output data.zip

Importing / Exporting in general

To read more about importing and exporting with Tolgee, continue to import section or export section.