Translations
Last updated
Was this helpful?
Last updated
Was this helpful?
Descriptive fields — such as names or descriptions — can be localized and translated into multiple languages.
In the Emporix Commerce Engine, localized fields are stored in the form of String-String maps, where the keys are language codes and the values are the translations.
Language codes must match the ones defined in your language configurations.
For more information on language configurations, check out the .
To create an object where field values are specified in one language, you need to call a POST
endpoint for a specific resource with the Content-Language
header set to the language's .
When you set the Content-Language
header to a specific language, you need to pass the localized fields as Strings.
What if I don't specify the fields' language?
If you do not specify a language in which the values are expressed, the Emporix API will assume the values are expressed in your tenant's default language.
Here's an example on how to create a measurement unit with its name in German:
To create an object where field values are translated to multiple languages, you need to call a POST
endpoint for a specific resource with the Content-Language
header set to *
.
When you set the Content-Language
header to *
, you need to pass the translations as maps of String-String pairs.
Here's an example on how to create a measurement unit with its name in multiple languages:
Here's an example on how to retrieve a product's localized fields in German:
To retrieve localized fields in all available languages, you need to call a GET
endpoint for a specific resource with the Accept-Language
header set to *
.
Here's an example on how to retrieve a product's localized fields in all available languages:
To add translations to an existing object's localizable fields, you need to call a PUT
or a PATCH
endpoint for a specific resource with the Content-Language
header set to *
.
When you add translations to an existing object, you need to always pass the translations as maps of String-String pairs.
Here's an example on how to add translations to a measurement unit's name:
To retrieve localized fields in one language, you need to call a GET
endpoint for a specific resource with the Accept-Language
header set to the language's .