Locales

Every channel must have a main locale which is set in the creation of the channel and it is immutable. You add or remove other locales later.

Locales are useful when you want to translate your content. You can choose which fields are translatable and which are not. For example, you may want to have your title translated but the cover image be the same for each language.

You have 2 ways to interact with the API. One is request a specific locale via the Accept-Language header and the other is to get all the available locales of your channel.

It the first case the content will be returned in this format:

{
	"id": "whatever-id"
   	"content": 
    {
    	"title": "An Amazing title"
    }
}

In the latter case the content will be formatted in this way:

{
    "id": "whatever-id"
    "content": 
    {
        "title": 
        {
            "en-US": "An Amazing title",
            "fr-FR": "An Amazing french title"
        } 
    }
}

The same goes when you write content on the API. The API will expect the header Accept-Language if you want to create or replace content on the specific locale. Otherwise, it will expect to submit all the locale's data.

You need to consider the following: If you specify a locale in the Accept-Language header, you must not include locales in your content and vice versa.

Please note that in this documentation, all demo requests are submitted with the Accept-Language: en-US header.

If you don't specify a locale and write data only for one locale, other locales data will get truncated

Deleting A Locale

Deleting a locale will not affect your content immediatly. Meaning that, not content is going to be deleted by this actions. By later updates of your content, will erase the content of non-existing locales.