Language Localization

Overview

Algonomy products offer support for multi-language sites with localizable product details, category names, and strategy messages. When a customer visits your site, instrumentation on the page provides a region, which defines the language to use.

Using localization allows users to use multiple languages on their sites to support customers to see strategy messages, categories, and product details in different languages, based on the instrumentation on the page.

Support for regions requires the use of a Regional Feed as well as the instrumentation of regions on all pages. The language is deduced by the region, as set in the region feed files

Languages 

In order to use languages, you need to define one region for each language you want to use—multiple regions can cover the same physical territory.

For example, you could set up a country like Switzerland with 3 regions and 3 languages:

Region ID

Language Tag

Switzerland-French

ch-FR

Switzerland-German

ch-DE

Switzerland-Italian

ch-IT

The chosen language controls which set of localized product attributes are shown in recommendations. 

Regions and languages are closely tied together, and configured in separate files in the region feed:

  • region_full.txt: setup for each region, including choosing the language for the region

  • localized_product.txt: product localization

  • localized_category.txt: category localization

  • product_region_full_sitename.txt: regional information for products (no localization in this file)

The files you need depend on how your regions and languages are set up.

Language Parameters 

Sites that leverage recsForPlacement API: 

In order to call specific languages, use the following parameters:

  • 'lang='

    • This stands for "language"

    • Example: lang=en-US

  • 'flo='

    • This stands for "force locale"

    • Example: flo=it-IT

The following parameter is not valid and should not be used, as it will not result in the desired result:

  • 'language='

Sites that leverage p13n: 

In order to call specific languages, the following methods can be used:

  • R3_COMMON.forceLocale('xx_XX')

    • Example: R3_COMMON.forceLocale('it-IT')

  • R3_COMMON.setLanguage('xx')

    • Example: R3_COMMON.setLanguage('it')

Note: If a localization for a product or category name is not available for a region or a locale, it should not be sent as a null value. It is advised to not send the record at all as null values causes issues in the catalog publishing process. 

Examples 

Multiple Territories, Each Has Its Own Language 

A company selling products in Scandinavia could have 3 regions, one for each currency and 3 languages. 

Region ID

Language Tag

Sweden

sv-SE

Norway

dk-DK

Finland

fi-FI

This site would need both the localized files (localized_product.txt and localized_category.txt) and the region files (region_full.txt and product_region_full_sitename.txt).

Multiple Physical Territories, Sharing a Language 

A company selling in France, Belgium, and Luxemburg could have three regions and one language. Prices and availability could be different in each country, but the language is the same.

 Region ID

Language Tag

France

fr-FR

Belgium

fr-FR

Luxemburg

fr-FR

This site does not need localized_product.txt or localized_category.txt, but needs region_full.txt and product_region_full_sitename.txt to cover different prices and availability.

Multiple Languages in One Physical Territory 

A company in Switzerland could have the site in multiple languages. All prices would be in Swiss Francs, so the pricing and availability information can be shared across different languages. Therefore, they will only have one region in the example below 'German' as the default language for the 'Switzerland' region.

Region ID

Language Tag

Switzerland

ch-DE

In the requests for recommendations, the language can be overridden using the 'lang' parameter in recsForPlacements or R3_COMMON.setLanguage('xx') in p13n.js. Similarly, the shoppers visiting the website from Switzerland in French, the Region ID is 'Switzerland' and the language is 'French'.

This site would need localized_product.txt and localized_category.txt to cover the languages. At the current state of the product, they would also need a region_full.txt, and a product_region_full_sitename.txt.

Localized Product Attributes

You can localize these product attributes in the Region Feed:

  • Product name

  • Product description

  • Link URL

  • Image URL

  • Category name

Strategy Messages

You can add localized strategy messages for each language set up in your feed. Localized strategy messages are automatically shown when valid region has been set.