The custom build JSON format for different purposes. In most cases you would like to use it to import translation keys and localized messages from different localization programs. SimpleLocalize will discover automatically what kind of JSON library you use.
{
"translation_key": {
"message": "my localized message"
},
"second_translation_key": {
"defaultMessage": "my localized message from FormatJS CLI output",
"description": "Your message to translators. It will also show up in the translation editor"
}
}
You can use simplelocalize-json
format with FormatJS CLI. Check FormatJS CLI integration guide.
Upload with CLI
simplelocalize upload --apiKey <PROJECT_KEY> \
--uploadFormat simplelocalize-json \
--uploadPath ./translations_{lang}.json
Learn more about SimpleLocalize CLI and translations upload feature.
Download with CLI
simplelocalize download --apiKey <PROJECT_KEY> \
--downloadFormat simplelocalize-json \
--downloadPath ./translations_{lang}.json
Learn more about SimpleLocalize CLI and translations download feature.
Import with API
curl
--request POST \
--url 'https://api.simplelocalize.io/api/v2/import?uploadFormat=simplelocalize-json' \
--header 'x-simplelocalize-token: <API_KEY>' \
--form file=@/path/to/your/file.json
Learn more about importing translations with API
Export with API
curl
--request GET \
--url https://api.simplelocalize.io/api/v3/export?downloadFormat=simplelocalize-json \
--header 'x-simplelocalize-token: <API_KEY>'
Learn more about exporting translations with API