Import translations from a file to the translation editor. This endpoint requires authorization.
Endpoint
POST
https://api.simplelocalize.io
/api/v2/import?uploadFormat=
Note: By default, the API will import only new translations, and it will not update existing ones. If you want to update existing translations, you need to use the
REPLACE_TRANSLATION_IF_FOUND
as import option.
Sample requests
Import all translations from one file
This example shows how to import all translations from multi-language-json file and update existing translations if found.
curl
--request POST \
--url 'https://api.simplelocalize.io/api/v2/import?uploadFormat=multi-language-json&importOptions=REPLACE_TRANSLATION_IF_FOUND' \
--header 'x-simplelocalize-token: <API_KEY>' \
--form file=@/path/to/your/all-translations.json
Import translations for one language
This example shows how to import translations for one language from single-language-json file.
curl
--request POST \
--url 'https://api.simplelocalize.io/api/v2/import?uploadFormat=single-language-json&languageKey=en' \
--header 'x-simplelocalize-token: <API_KEY>' \
--form file=@/path/to/your/english-translations.json
Query parameters
Parameter | Description |
---|---|
uploadFormat | See all available upload formats |
languageKey | Language key for the file |
importOptions | See all available import options |
Successful response
{
"numberOfKeysFound": 2137,
"numberOfUniqueKeysFound": 1004,
"foundLanguages": [
{
"key": "pl",
"name": "Polish"
}
]
}
Was this helpful?