API: Import translations

Last modified: July 24, 2021Author: Jakub Pomykała

Import translations from a file. Check 'Import options' section to learn more about possibilities. Using this endpoint requires authorization.

POST Endpoint

https://api.simplelocalize.io/api/v2/import?uploadFormat=

Example cURL

Import all translations from one file

curl
  --request POST \
  --url 'https://api.simplelocalize.io/api/v2/import?uploadFormat=multi-language-json' \
  --header 'x-simplelocalize-token: <API_KEY>' \
  --form file=@/path/to/your/all-translations.json

Learn more about multi-language-json.

Import translations for one language

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

Learn more about single-language-json.

Query parameters

Parameter Description
uploadFormat Set upload format to tell API how we should read the file with translations
languageKey Set language key if you want import translations for only one language
importOptions Set import options to do invoke custom logic after or during the import

Available uploadFormat values

uploadFormat Description
multi-language-json JSON file with all translations
single-language-json JSON file with one language (use languageKey param to specify language)
simplelocalize-json JSON format prepared for integration purposes
excel Microsoft Excel spreadsheet in *.xlsx format
csv , or ; separated translation keys
yaml yaml file format
android XML Resource Strings file
localizable-strings Localizable.strings file format
java-properties Java properties file
po-pot PO/POT files
php-array PHP Array file
module-exports module.exports file

Available importOptions values

Use query param importOptions to do invoke custom logic after or during the import. You can pass more than one import option. If you need more import options let us know: [email protected]

importOptions Description
REPLACE_TRANSLATION_IF_FOUND Replaces translation for key if the key already exists. Without this option SimpleLocalize will only add new translations.
PUBLISH_AFTER_IMPORT Translations will be published automatically to the CDN after successful import. Option available only in Developer and Team plan. Check also how to publish translations using API endpoint

Deprecated endpoints

POST Deprecated endpoint (2021-01-24)

https://api.simplelocalize.io/api/v1/import

POST Deprecated endpoint (2019-12-10)

https://api.simplelocalize.io/api/v1/files