Update translations

Update translation text for given key and language. Using this endpoint requires authorization.

PATCH Endpoint

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

curl 
    --location 
    --request PATCH 'https://api.simplelocalize.io/api/v1/translations' \
    --header 'X-SimpleLocalize-Token: <API_KEY>' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "content": [
            {
                "key": "EXAMPLE_TRANSLATION_KEY",
                "language": "en",
                "text": "example text"
            }
        ]
    }'

Example successful response

{
  "msg": "OK",
  "status": 200,
  "data": {
    "numberOfUpdates": 2,
    "numberOfFailures": 4,
    "numberOfInserts": 1,
    "failures": [
      "Cannot update translation. Translation key value is empty.",
      "Cannot update translation. Language value is empty for key 'MY_TRANSLATION_KEY'.",
      "Cannot update translation. Language 'wrong-lang-key' does not exist in the project.",
      "Cannot update translation. Translation key 'MY_TRANSLATION_KEY' does not exist in the project."
    ]
  }
}

Available update options

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

updateOptions Description
CREATE_KEY_IF_NOT_FOUND Creates translation key which are not present in the project.

Check how to publish translations using API