Locales

Fetching locale data

To fetch data from the API in the correct locale, follow options are available:

  • if the locale is provided in the headers via Accept-Language, the information will be returned in the requested locale

  • if the user is provided, the locale stored for the user will be used to return the information in the correct locale

  • if no locale or user is provider, the default locale for the platform will be used to determin the correct locale

Storing locale data

Translatable items are stored with the localeCode as a key in the key-value pair object.

.country.name.be-NL

Example

{
    "country": {
        "@type": "Country",
        "code": "",
        "name": {
            ":localeCode": ""
        }
}

Default locale

Every instance must have a default locale. If no locale is provided to the API, the default locale is used to fetch & deliver the correct data.

Last updated