Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Translations

Translations use language-code maps, enabling objects to be created, retrieved, and updated in one or multiple languages.

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.

This page covers first-class localized fields on resources such as products and measurement units. Mixin attribute localization, including localized OBJECT maps when languageSchemaVersion is set to v2, is documented in How to use localized OBJECT mixin attributes and Localized mixin attributes. On reads, first-class fields can return a single string for one language, while filtered mixin language maps remain single-key maps.

How to create a localized object in a specific language

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 IETF BCP 47 tag.

Here's an example on how to create a measurement unit with its name in German:

How to create a localized object in multiple languages

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 *.

Here's an example on how to create a measurement unit with its name in multiple languages:

How to retrieve a localized object in a specific language

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 IETF BCP 47 tag.

Here's an example on how to retrieve a product's localized fields in German:

How to retrieve a localized object in all available languages

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:

How to add localized fields to an existing object

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 *.

Here's an example on how to add translations to a measurement unit's name:

Last updated

Was this helpful?