Using One Template Set to Localize

The Storefront Reference Architecture (SFRA) application provides a simple way to localize any text that appears in the storefront. It uses a single template set for all locales, stored in properties files (called template resource bundles). The template resource bundles are translated, not the templates. The templates reference the localizable text in the template resource bundles by keys. Depending on the locale that is used in the storefront, a different translation (localization) of the properties file is used.

Projects typically start from the SFRA application code, so it's important that you use this approach consistently.

Directory Structure

To support multiple languages, you can create language-specific (for example, en) or locale-specific (for example, en_US) directories within the templates/resources directory, as follows:

	/resources - default files

Salesforce B2C Commerce (and the SFRA application) supports a localization fall-back mechanism. If no locale-specific directory exists, the language-specific directory is used. If there is no language-specific directory, the default directory is used.

There is a corresponding template resource bundle for each folder in the templates directory and one for the forms definitions.

X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used. By continuing to use this site you are giving us your consent to do this. Privacy Policy.