Localization
This page is outdated. Please go to our new documentation under https://docs.fulfillmenttools.com/documentation.
The fulfillmenttools platform supports localization, enabling you to manage data in multiple languages. This document outlines how to change user and platform locales, request specific languages for your requests, and handle localized information in entities.
Supported Localization Features
User-specific locales: Determined by user settings in the authentication token.
Request-specific languages: Can be specified using a
locale
query parameter.Localized entity fields: Store and retrieve localized field values.
Supported Languages
A list of currently supported languages can be found via the API. All supported languages are also available in the Backoffice and other fulfillmenttools applications.
GET / HTTP/1.1
Host: %%HOST%%
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
[
"de_DE"
]
Requesting Specific Languages
To request data in a specific language, add the locale
query parameter followed by the language code, conforming to the ISO 639-1 standard.
Example request for a specific language
GET /api/endpoint?locale=de_DE
Fallback Language Mechanism
If a requested language is unavailable, the platform uses the following fallback order:
Language specified in user settings.
Default platform language.
English (
en_US
).First available language for the entity.
Non-localized field value of the entity.
Handling Localized Information in Entities
Each localizable entity schema contains fields and their corresponding localized versions, which are stored as objects with locale codes as keys.
Example of localized entity fields
{
"title": "My Product",
"titleLocalized": {
"de_DE": "Mein Produkt",
"fr_FR": "Mon produit",
"nl_NL": "Mijn product"
}
}
GET requests return localized values based on the user's locale.
POST, PUT, and PATCH requests must provide all localized values for the desired locales. Partial updates of localized values are not supported.
Using Entities Without Localization
If localization is not required, omit the <fieldName>Localized
object and provide the non-localized field directly.
Example of non-localized usage
{
"title": "My Product"
}
Changing the User Locale
To change the user locale, send a PATCH
request to the user endpoint, including the new locale in the request body. After the change, you must request a new authentication token to reflect the locale update.
ID of the user you want to patch
The version of the document to be used in optimistic locking mechanisms.
42
PATCH / HTTP/1.1
Host: %%HOST%%
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 315
{
"actions": [
{
"action": "ModifyUser",
"firstname": "Alex",
"lastname": "Schneider",
"locale": "de_DE",
"password": "fsdf6556",
"roles": [
{
"facilities": [
"0T1vKaEar0nuG58CxzA5"
],
"name": "FULFILLER"
}
],
"assignedFacilities": [
{
"facilityRef": "0T1vKaEar0nuG58CxzA5",
"assignedZones": [
{
"zoneRef": "LGMl2DuvPnfPoSHhYFOm"
}
]
}
]
}
],
"version": 42
}
{
"created": "2020-02-03T08:45:51.525Z",
"lastModified": "2020-02-03T09:45:51.525Z",
"version": 42,
"customClaims": {
"roles": [
{
"facilities": [
"0T1vKaEar0nuG58CxzA5"
],
"name": "FULFILLER"
}
]
},
"firstname": "Alex",
"id": "LGMl2DuvPnfPoSHhYFOm",
"lastname": "Schneider",
"locale": "de_DE",
"username": "aschneider",
"authenticationProvider": {
"type": "EMAIL_PASSWORD",
"id": "LGMl2DuvPnfPoSHhYFOm"
},
"assignedFacilities": [
{
"facilityRef": "0T1vKaEar0nuG58CxzA5",
"assignedZones": [
{
"zoneRef": "LGMl2DuvPnfPoSHhYFOm"
}
],
"id": "LGMl2DuvPnfPoSHhYFOm"
}
]
}
Changing the Default Platform Locale
The default platform locale sets the standard language for the frontend applications. Change it by sending a PUT
request to the relevant configuration endpoint.
ISO 3166 conform country code and ISO 639-1 conform language code (de_DE, en_US, ch_FR, etc.)
de_DE
Possible values: PUT / HTTP/1.1
Host: %%HOST%%
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 188
{
"locale": "de_DE",
"countryLanguageMapping": {
"DE": "de_DE",
"US": "en_US",
"RU": "ru_RU"
},
"id": "text",
"created": "2020-02-03T08:45:51.525Z",
"lastModified": "2020-02-03T09:45:51.525Z",
"version": 42
}
{
"locale": "de_DE",
"countryLanguageMapping": {
"DE": "de_DE",
"US": "en_US",
"RU": "ru_RU"
},
"id": "text",
"created": "2020-02-03T08:45:51.525Z",
"lastModified": "2020-02-03T09:45:51.525Z",
"version": 42
}
Last updated
Was this helpful?