Localizations

Use these methods to manage localization settings, such as date and time formats or characters used as decimal separators, specified for supported languages.

GET[host]/api/v2/localizations

Get a list of localization options

GET[host]/api/v2/localizations/{localizationId}

Get localization option details

PUT[host]/api/v2/localizations/{localizationId}

PATCH[host]/api/v2/localizations/{localizationId}

Update a localization option

Get a list of localization options

Use this method to obtain a list of localization options configured in the Back Office.

To obtain detailed information about a specific localization option, use a separate method to get localization option details.

Request

Header parameters:

  • Authorization: Bearer <access_token>

GET[host]/api/v2/localizations

curl --location --request GET 'https://host.name/api/v2/localizations?limit=10&offset=0' \
--header 'Authorization: Bearer <token>'

Response

A response contains an array of Localization objects providing information about the available localization options.

Get localization option details

Use this method to obtain detailed information about a specific localization option.

To obtain a list of available localization options, use a separate method to get a list of localization options.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

localizationId required

The localization option identifier.

GET[host]/api/v2/localizations/{localizationId}

curl --location --request GET 'https://host.name/api/v2/localizations/1' \
--header 'Authorization: Bearer <token>'

Response

A response contains a Localization object providing information about a specified localization option.

Update a localization option

Use this method to update a specified localization option.

Note

Instead of the method described below, you can use a similar method that uses the HTTP verb PATCH.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters

localizationId required

The localization option identifier.

Body:

The following field values can be updated for a specified localization option.

caption string

The name of a language for which localization settings are configured.

isEnabled boolean

If true, a language can be selected by clients in the B2Core UI; otherwise, false.

isDefault boolean

If true, a language and the localization settings specified for it are applied by default; otherwise, false.

isRightToLeft boolean

If true, text strings are displayed in the right-to-left direction; otherwise, false.

priority integer

The priority index assigned to a localization.

format object

The details about format settings specified for a localization option.

Show object fields
decimal string

A character used as a decimal separator.

fullDate string

The full date format (such as l, F j, Y).

fullTime string

The full time format (such as h:i:s A T).

longDate string

The long date format (such as F j, Y).

middleDate string

The middle date format starting with the month (such as M j, Y).

middleTime string

The middle time format (such as h:i:s A).

name string

The person name format (such as {title} {givenName} {familyName})

shortDate string

The short date format (such as h:i A)

shortTime string

The short time format (such as h:i A).

thousands string

A character used as a thousands separator.

PUT[host]/api/v2/localizations/{localizationId}

curl --location --request PUT 'https://host.name/api/v2/localizations/1' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "caption": "English",
  "isEnabled": true,
  "isDefault": true,
  "isRightToLeft": false,
  "priority": 1,
  "format": {
    "decimal": ".",
    "fullDate": "l, F j, Y",
    "fullTime": "h:i:s A T",
    "longDate": "F j, Y",
    "middleDate": "M j, Y",
    "middleTime": "h:i:s A",
    "name": "{title} {givenName} {familyName}",
    "shortDate": "d.m.Y",
    "shortTime": "h:i A",
    "thousands": " "
  }
}'

Response

A response includes a Localization object providing information about the updated localization option.