Versioning

It's possible to submit requests that indicate that previous localized content has changed. This feature is called versioning and works by referencing previously submitted content requests.

As these requests reference old content we can figure out the differences and only update what is needed in the localization. To use this feature you currently need to reference the previous request via its generated identifier.

Importing old content

To support versioning of already localized content it's possible to import content. A content request that is to be imported is similar to a normal request, but is marked with the type import. In addition to this every field in the request requires both originalValue and value. When an import request is submitted it automatically marked as completed as no work will be done with it, you can then reference the id returned when submitting update requests.

Example:

{
    "type": "import",

    "language": {
        "source": "sv",
        "target": "en"
    },
    "fields": [
        {
            "id": "body",
            "type": "localizable",
            "data": "html",
            "originalValue": "<p>Denna text kan innehålla <strong>HTML taggar</strong></p>",
            "value": "<p>This text can contain <strong>HTML tags</strong></p>"
        }
    ]
}

Updating content

When you want to submit an update to a content request that has been previously submitted or imported you can mark the request with the type update. Figuring out what has changed is done via matching the old field values with the new values, this is done by comparing the via their identifier. It is possible to add on new fields in an update, in which case they are equivalent to fields in a normal content request.

{
    "type": "update",
    "previous": "idOfPreviousVersion",

    "language": {
        "source": "sv",
        "target": "en"
    },
    "fields": [
        {
            "id": "body",
            "type": "localizable",
            "data": "html",
            "value": "<p>Denna text kan innehålla <strong>HTML taggar och annat</strong></p>"
        }
    ]
}

results matching ""

    No results matching ""