Skip to main content

Explore Translation and Localization

Learning Objectives

After completing this unit, you’ll be able to:

  • Explain the difference between translation and localization.
  • List the general steps you need to take to localize a Salesforce B2C Commerce storefront.
  • List why you’d use country codes.
  • Explain how localization fallback works.

Translate and Localize

Cloud Kicks Corporation, a high-end sneaker and apparel manufacturer, wants to sell its products internationally. Their storefront—built on B2C Commerce—is in English. So Brandon Wilson, Cloud Kicks merchandiser, investigates how he can localize it.

Brandon Wilson, Cloud Kicks merchandiser

That means adding support for different languages, currency, time zones, taxations, and more. Translating the text on the storefront involves translation, but what else does Brandon need to consider? And what exactly does translation and localization mean? 

Translation is the process of changing content from one language to another. Localization, however, is a whole lot more. It considers a geographic location’s culture and the visual and technological aspects of supporting a site with users of a different language and culture. As you can see, translation is just one part of the localization process.

In B2C Commerce, localization means configuring a storefront and its data to handle a variety of locations, and configuring Business Manager so that those who configure the storefront can do so in their preferred language.

Business Manager Locales

Business Manager supports multiple languages in both its user interface and in the underlying data that Brandon can create, edit, and display within it. Brandon can configure different locales for viewing the application and managing the data. For example, he can configure a user to view English products and content using a Japanese version of Business Manager.

Two types of login IDs can select the Business Manager user interface locale.

  • Administrator: The administrator selects a preferred locale for the Business Manager display language from a list of possible languages. They can assign a user’s preferred locale when creating or editing the user’s profile.
  • User: A Business Manager user can edit their user profile to select a different Business Manager display language. The new locale appears until they select another language.

When the admin configures a user’s preferred locale, Business Manager defaults to this locale for Business Manager pages and corresponding data, such as these.

  • Product
  • Catalog
  • Content
  • Search
  • Promotion rules
  • Customers
  • Custom objects
  • Ordering
  • Organization
  • Site development

In this module, we assume you are a B2C Commerce merchandiser with the proper permissions to perform these tasks. If you’re not a B2C Commerce merchandiser, that’s OK. Read along to learn how your merchandiser would take these steps in a staging instance. Don’t try to follow our steps in your Trailhead Playground. B2C Commerce isn’t available in the Trailhead Playground.

If your site uses B2C Commerce but you don’t have access, contact your administrator for login credentials. If you have a B2C Commerce sandbox instance, you can try out these steps on that instance. If you don’t have a sandbox and you’re a customer or partner developer, ask your manager if there is a sandbox that you can use.

In this case, the administrator configures a user’s preferred locale. Here’s how they do it.

  1. Select Administration > Organization > Users.
  2. Search for and open a user record.
  3. Select the Preferred UI Locale: Organization Default (English (Default))
  4. Select the Preferred Data Locale: Organization Default (Default)
  5. Click Apply.
Note

B2C Commerce does not handle certain Unicode Transformation Format (UTF) characters that are right to left. For example, gift certificates purchased under the United Arab Emirates Dirham (AED) currency do not show the amount under the list view. If you use the AED currency, we recommend that you show the amount value prefixed with the abbreviation currency, for example, (AED) 250. You can do this in Merchant Tools > Online Marketing > Gift Certificates.

B2C Commerce Localization

Brandon is happy to learn that B2C Commerce is localizable inside and out—from the internal storefront data to the text and graphics that displays on the storefront.

This is his initial plan.

  1. Identify which components of the storefront require localization, for example, content assets, products, product attributes, and currency.
  2. Determine how to architect localization for the business: Processes use localized templates or properties files, depending on the approach.
  3. Identify which languages to support and how they interrelate.

Brandon might decide to use, for example, the same underlying business objects for the USA/English and Latin America/Spanish storefronts. The shopper will be able to select a location on the storefront, which tells B2C Commerce the file set to use.

When selling in Europe, Brandon might decide to offer products by country, which requires specific catalog data for each locale.

Note

B2C Commerce supports Asian languages.

Country Codes

B2C Commerce supports two-character country codes per the ISO 3166-1-alpha-2 standard. B2C Commerce doesn’t support other standards, such as 3-letter codes. Using them might result in some features no longer working correctly. For example, if Brandon decides to store 3-letter country codes in order addresses, the export of these orders will fail because the files don’t conform to the B2C Commerce order.xsd schema.

B2C Commerce uses country codes for:

  • Customer address and order address
  • Tax jurisdictions
  • Store locator
  • Rule evaluation of a dynamic customer group
  • Shipping address exclusion
  • Product lists
  • Geolocations

Localization Fallback

B2C Commerce performs fallback processing with localized resources such as business object data, images, templates, and messages; and for search dictionaries. 

Dictionary Fallback

Within Business Manager, Brandon can define how linguistic search rules (stop words, category name exclusions, synonyms, hypernyms, compound words, common phrases, search suggestions, and stemming exceptions) are applied in a multi-locale site.

Once he configures the locales he wants, he must rebuild locale-specific search indexes. When a shopper selects a locale (language) on the storefront—unless it’s the default locale and automatic—and then searches on the storefront, B2C Commerce uses the locale-specific search index.

Locale Fallback

The locale fallback mechanism controls what displays on the storefront, such as choosing in which language to display a message or which image to display for a product. Or Brandon might want, for example, locale-specific product images to showcase something unique about the locale, instead of a generic image.

Here’s the B2C Commerce locale fallback mechanism.

  1. Is there data or an image for the specified country (for example, en_us)?
  2. If not, is there data or an image for the specified language (for example, en)?
  3. If not, use the data or image that’s available for the default locale.

The B2C Commerce fallback mechanism automatically checks country, language, and then default for locale-specific data or files.

Brandon can configure B2C Commerce to skip a locale in its fallback chain, or to not have a fallback at all. For example, he can configure en_US to fallback directly to default or  configure en_US to not have a fallback.

When you configure one locale as the fallback for another locale, however, you can’t delete the first locale: An error message appears. For example, if you configure en_US > en > default, you can’t delete en because it’s the fallback for en_US. If you try to import en in delete mode, an error message appears in the import log.

You can disable the fallback behavior for each locale. For example, when Brandon (accidentally) disables the fallback for the en locale for a product description, no description displays on the storefront for that product.

Example: Multilanguage Across Sites

If you support multiple languages across sites, you might want to use a second language as the default language. Here are the French language codes, for example.

Language (Locale) Code

French (Belgium)

fr-BE

French (Canada)

fr-CA

French (Switzerland)

fr-CH

French (France)

fr-FR

French (Luxembourg)

fr-LU

French (Monaco)

fr-MC

Brandon uses French fr-FR for the default language for France, Switzerland, and Luxembourg, but uses country-specific resources for a portion of the data. This way, multiple sites can use shared resources; Brandon can localize most of the data based on that one language instead of the region. While he uses some region or country-specific resources, most of the resources are the same.

Note

Make sure directory names for locale-specific templates consist of a language and a country code, as specified in the standard ISO 639 (language) and ISO 3166 (country).

Example: Three Sites

B2C Commerce templates define how a web page displays. You can use different templates for different locales, even though the locales share the same language. You can also share templates between different locales with the same language. For example, Brandon wants to configure a multi-site environment with three sites.

Country Country Code Locale

United States

US

en_US

Great Britain

GB

en_GB

Ireland

IE

en_IE

All main templates are shared between these locales. Brandon can make country-specific changes to each site, for example, to show the different country icons in the top left-hand corner of the Welcome page. To do this effect, Vijay Lahiri, Cloud Kicks developer, creates three welcome templates, each with the language-specific image or logo, each stored in a locale-specific folder.

.../cartridge/templates/en_GB/welcome.isml
.../cartridge/templates/en_IE/welcome.isml
.../cartridge/templates/en_US/welcome.isml

Next Steps

In this unit, you learned the difference between translation and localization, Business Manager locales, and how localization fallback works. Next, learn how to configure locales.

Resources

Share your Trailhead feedback over on Salesforce Help.

We'd love to hear about your experience with Trailhead - you can now access the new feedback form anytime from the Salesforce Help site.

Learn More Continue to Share Feedback