How StoreFront handles static text and multi-lingual support
On a current theme, the content you add in the StoreFront Visual Builder is translated for you automatically and static text is not something you need to think about. This page covers what that means in practice, and what to do if you are running an older hand-built theme where it is still a concern.
Build your content with Visual Builder elements
When you add a headline, text block, HTML element, or button in the StoreFront Visual Builder, that content is automatically registered for translation. You write it once in English and UltraCart handles translating it into every language you have enabled, including generating the lang attributes search engines expect.
You do not need to do anything special, and you do not need to touch template code. To edit the wording for a particular language, see Multi-Language Content in the Visual Builder.
Older hand-built themes
Themes built before the Visual Builder, such as Mr Teas and Woodland, were hand-coded and relied on template-level translation calls for every piece of static text. Those themes still work, but they are legacy and are no longer the recommended way to build a storefront.
If you are running one of these themes and want reliable multi-lingual support, the better path is moving to a current theme and building your content with Visual Builder elements rather than maintaining translation calls by hand. See StoreFront Languages for which themes support internationalization.
Developers maintaining a legacy hand-built template can find the underlying translation object documented in the $i18n StoreFront object reference. This is not something merchants should need.
Keeping specific text untranslated
The opposite problem, text that must never be translated such as a brand name or model number, has its own solution that works in both the Visual Builder and template content. See Preventing Content from Being Translated.
Related
- Multi-Language Content in the Visual Builder for editing translated content.
- StoreFront Languages for enabling languages and checking theme support.
- Preventing Content from Being Translated for the
notranslatespan.