Localizing Static Files

You can localize static files such as images and CSS.

Images

Localizing static files such as images enables you to include images that contain localized text or locale-specific symbols. Your initial system includes the following structure:

Location Contains Localized
cartridge\web_ch_cust_app\cartridge\static\default English (or default) images (such as buttons), JavaScript (including English error messages), css files. (all are in the cod) No
sites\Sites-cust-Site\1\units\Sites-cust\static\default English (or default) content and category images, category images and homepage images (all are from the content library) Yes - text overlay
Note: You can include an images folder within the locale-specific folder, but the SiteGenesis application doesn't use this capability for cartridge images.

If a user calls the URL using locale es_US, the files in folder es_US are loaded first. If they are not found, Salesforce B2C Commerce uses the default folder as a fallback. So within a local-specific folder, you need only include files that are truly locale-specific (not background images, for example).

Note: This logic occurs on a per file basis.

CSS Files

Your file system must have unique, locale-specific folders. For example, to support both English and Spanish (es_US), create a second es_US folder within the /static folder that lets B2C Commerce overwrite the default files. The included files must have the same names as the files under default and the same folder structure.

In the following directory structure, for example, the localized files are stored in language-specific directories (French and German). You can also use locale-specific directories (for example, fr_FR, fr_CA, en_US).

/Cartridge
	/static
		/default
			/css - generic files
				normalize.css
				print.css
				style-responsive.css
				style.css
			/images
				generic images
			/js - generic files
		/fr
			/css
				normalize.css
				print.css
				style-responsive.css
				style.css
			/images
				localized images
			/js
		/de
			/css
				normalize.css
				print.css
				style-responsive.css
				style.css
			/images
				localized images
			/js