Add translations

This endpoint allows you creating new internationalization keys and translations. Check importOptions section to learn more about possibilities. If you use this endpoint, note that it requires authorization.

POST Endpoint

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

Example cURL

curl 
--location 
--request POST 'https://api.simplelocalize.io/api/v1/translations?importOptions=REPLACE_TRANSLATION_IF_FOUND' \
--header 'X-SimpleLocalize-Token: <API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "content": [
        {
            "key": "EXAMPLE_KEY",
            "language": "en",
            "text": "example text"
        },
        {
         "key": "SALE",
         "language": "pl",
         "text": "Sprzedaż"
        }
    ]
}'

Import options

Use query param importOptions to do invoke custom logic after or during the import. You can pass more than one import option.

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.

If you need more import options let us know: [email protected]