Building a multilingual site
This page is for website creators who build a site in more than one language. In Exponential every object can hold a translation per content language, and every siteaccess decides which languages it shows, in which order. The full reference is Content languages; this page is the site builder's path through it.

Contents
- How languages work
- Step by step: adding a second language
- Fallbacks and untranslated content
- Translators
- Templates and interface texts
- Things that delete content
- Checklist
How languages work
- Adding a content language translates nothing and changes no siteaccess. It only makes the language available for translations.
- A siteaccess shows each object in the first language of its
SiteLanguageList[]that the object has. - Objects in none of those languages are hidden, unless they are marked "always available" or the siteaccess has
ShowUntranslatedObjects=enabled. - Every object has a main language.
- Exponential knows a large set of locales, including right-to-left ones (Languages in Exponential). More than 30 content languages need a 64-bit PHP, because the languages of an object are stored as bits of one integer (2.2 PHP).
Step by step: adding a second language
From Adding German to an English site:
Add the language in Setup > Languages > Add language (for example
ger-DE).Give it a siteaccess. Copy
settings/siteaccess/sitetosettings/siteaccess/site_deand set:# settings/siteaccess/site_de/site.ini.append.php [RegionalSettings] Locale=ger-DE ContentObjectLocale=ger-DE SiteLanguageList[] SiteLanguageList[]=ger-DE SiteLanguageList[]=eng-US ShowUntranslatedObjects=disabled TextTranslation=enabledRegister it in
AvailableSiteAccessList[]andRelatedSiteAccessList[]and set up matching: a path (/de) or a host (Language switchers and addresses per language).Clear caches:
php bin/php/ezcache.php --clear-tag=ini,content --allow-root-user(and the Velocity response cache,./console exp:velocity cache clear --apply, when Velocity serves the site).Translate, starting with the front page and the menu folders.
Mark shared objects always available (media folders, users) so they show without a translation.
Check the German address.
Fallbacks and untranslated content
| Wanted | Setting |
|---|---|
| Show English where German is missing | SiteLanguageList[]=ger-DE then eng-US |
| Hide what is not translated | ShowUntranslatedObjects=disabled and no second language in the list |
| Show everything in its main language when nothing else fits | ShowUntranslatedObjects=enabled |
| An object that appears in every language as it is (logo, a PDF) | mark it always available |
Translators
Give translators a role with content/translate and content/edit limited by Language to their language, plus
read access to the content. They then edit only their translation
(Roles and policies).
Templates and interface texts
- Texts written in templates go through
|i18n( 'design/mysite' )and are translated in.tsfiles of your design extension;TextTranslation=enabledandLocalechoose the catalogue (the translations cookbook,doc/eng-us/examples/cookbook/translations.md). - Dates and numbers follow the siteaccess's
Locale. - Set
langon the<html>element from$site.http_equiv.Content-language.
Things that delete content
- Removing a translation deletes that translation for good.
- Removing a language is only possible when no object and no class uses it, so it never deletes content.
- Changing
ContentObjectLocaleon a site with content needs care; read the warning insettings/site.inifirst.
Checklist
- To do: One siteaccess per language, each with its
SiteLanguageList[],LocaleandSiteName. - To do: The fallback order decided and written down.
- To do: Shared objects marked always available.
- To do: Translators limited to their language.
- To do: The design's own texts translated.
- To do: A language switcher on every page (Language switchers).
- To do: Right-to-left languages checked (Right-to-left sites).
Related pages
- Languages (for editors)
- Planning multisite and multilingual projects
- 10.14 Multi-language sites
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.