Multi-Language Support

Set up your section to support multiple languages for sites serving multiple locations

Dynamic Yield supports multi-language sites by enabling you to:

  • Fire events in various currencies on the same site.
  • Localize variations based on language/country.
  • Localize recommended products based on language/country.

The developer's role in this effort is primarily in the areas of implementing events (see the supported currencies and language codes in this section) and setting language context on the website pages.

Localizing content

You can serve different content to users in different locations. This is currently available only for API campaigns, dynamic content emails, and web personalization campaigns that are not based on a variation feed.

Add language context on every page

If your site supports multiple languages (or versions of the same language in multiple countries), add an lng parameter to the page context of every page on your site. For example:

DY.recommendationContext = {type: 'HOMEPAGE', lng: 'en_GB'};

See the supported language codes page for details.

Add language context for email

To support multiple languages in Experience Email, see the Configure ESP parameters section in the Experience Email article.

Localizing recommended products in the product feed

One way to adapt product recommendation campaigns based on the user locale is to display localized product properties. For filtering based on locale, see the Knowledge Base article.

For example, you can use different product names in the feed for different languages.

To add localized values of any product property (such as price, name, or description), add a column to your product feed with the following format:

“lng:<language code>:<column name>”: “<value>”

For example, if your default language is English and you want to add a German version of the product name, add a column called "lng:de_DE:name", and set the German value for the name as follows:

    "name":"White Pants"
    "lng:de_DE:name":"weiße Hosen"

The language code should match the name you use in the page context. For details, see Setting Page Context. The language code can have up to two (_) or (-) between the values. For example: "lng:en_EN_X".

Because these columns are optional, blank values do not trigger errors or warnings.

You can create a total of up to 300 columns when working with multiple languages (including all mandatory, custom, and translated columns). 

🚧

Note the following when setting up your feed columns

  • Do not leave empty values. If you do, while the feed preview appears empty, the system assigns the following values for this filter:
    • lng:Price – 0
    • lng:In stock – true

Take this into consideration when deciding.

  • Make sure all lng columns have a default column (for non-mandatory columns). For example, if you use the column "lng:FR:discounted", you must also have the column "discounted", as in the example above.
  • Translated content: Multi-language sections cannot use translated content in context or feed to match the set default language ("lng").