Localizing resource bundles, templates, forms and static files
How Resource.msg and msgf find strings across cartridges and locales, how locale folders localize templates, form definitions and static files per file, and why the Business Manager locale fallback applies only to persistent object attributes.
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.
~7 min read · 13 practice questions ·
What the exam expects
- Externalize storefront text into properties files and predict what
Resource.msgandResource.msgfreturn, including across cartridges and for missing keys. - Localize templates, form definitions and static files with locale folders, and know that the lookup works per file with a default fallback.
- Distinguish the configured locale fallback (persistent object attributes) from the cartridge file lookup (templates, forms, resource files, static content).
- Avoid encoding, country code and URL mistakes: UTF-8 properties files, ISO 3166-1 alpha-2 codes, locale-first URLs.
- Render an email template in a locale other than the request's.
Key terms: resource bundle (a set of .properties files with a common name under templates/resources); locale folder (a folder such as fr_CA next to default holding locale-specific files); locale fallback (the configurable chain, by default en_US to en to default, used for localizable object attributes); localizable attribute (a persistent object attribute with a value per locale); template resource bundle (the properties files SFRA's single template set reads its text from).
Key facts
- Detail
- One template set; translate the resource bundles
- Detail
Resource.msgreturns the key itself
- Detail
Resource.msgthrows an exception
- Detail
- Per key, cartridge by cartridge along the site path
- Detail
- UTF-8; Unicode escapes supported
- Detail
- Per file: locale folder, then default
- Detail
- Same-named definition in a locale folder beside
forms/default
- Detail
- PersistentObject attributes only
- Detail
- Nothing is returned
- Detail
- Deprecated
- Detail
- ISO 3166-1 alpha-2 only
- When does Business Manager refuse to delete a locale?
- Why does a single template set make translation safer?
- What does
Resource.msgfdo when null is passed for its arguments? - Which bundle does
Resource.msgread whenbundleNameis null?
The questions are free to read. Answers with their sources and self-grading are included with the pack.
Keep reading with the B2C Commerce Developer pack
- Core concepts
- Exam traps
- Worked scenario
The pack includes:
- All 28 lessons of the B2C Commerce Developer guide, with reading progress
- Interactive decision walks and step-by-step sequence steppers
- Practice exams purchase adds inline bank questions and topic practice (13 questions for this lesson)
- An official source cited for every claim
- An AI tutor that answers from the guide
- Choose guide-only, practice-only, or save $4 with both