Cert++
Close

Localizing static files such as images, CSS, and client-side scripts

Key Takeaway

To localize a static file, put only its translated version in a locale folder next to default, with the same file name and folder path. B2C Commerce falls back to the default folder for each file that the locale folder doesn't have.

Static files are the images, CSS files and client-side JavaScript files that a storefront sends to the browser as they are. B2C Commerce localizes them with translated copies in a folder named for a locale, next to the default folder. A shopper in that locale gets the locale version of a file when one exists and the default version when it doesn't.

Which static files to localize

Localize a static file when it holds locale-specific content. Examples include:

  • Images with text, such as buttons, or with locale-specific symbols
  • CSS files
  • JavaScript files that contain text, such as English error messages

Static files start out in a folder named default. The default files sit in these folders:

Default folderHolds
Cartridgestatic/defaultDefault (English) button images, JavaScript files and CSS files
Content libraryThe site's static/default folderContent, category and homepage images

In the content library, localization applies to images with text overlay.

B2C Commerce Developer Study Guide

Checklist progress

0/237Learned

Given localization requirements, implement and enhance templates, form definitions, static files, properties files, and persistent object attributes to ensure that pages are displayed in the expected language

0/8

Prepare for the Exam

Play Today's Certle

Study Community

Ask questions and get the latest info from other B2C Commerce Developer studiers. 796 members and growing.