OCAPI Localization 23.1
The Open Commerce API supports localized content.
The Shop API supports a single locale at a time. You can specify the locale by setting the
*locale* parameter, which takes values in the format <language code>-<country code>. Otherwise, the Shop API uses the default locale of the site. Note: In Shop API the following locale fallback is performed: Locale (en-US) > Language Locale (en) > Default locale (default). The following example shows how you can explicitly specify a locale:
The Data API supports multiple locales at the same time. By default, localizable properties are returned as a map of all available localized values keyed by the locale identifier. However, you can explicitly specify a single locale by setting the
locale parameter, which takes values in the format <language code>-<country code>. If you explicitly specify a locale, localizable properties are returned as a single map entry. Note: In Data API no locale fallback is performed.
The first example shows the default behavior, which returns a map of multiple localized values:
The second example shows a response for an explicitly specified locale: