A siteaccess per language
This page is for administrators and site builders. A multilingual site usually has one public siteaccess per language, all sharing one database. Each decides which content languages it shows and in which order, its interface language and its address (Content languages, section 5).
Contents
The settings of one language siteaccess
# settings/siteaccess/site_fr/site.ini.append.php
[RegionalSettings]
Locale=fre-FR
ContentObjectLocale=fre-FR
SiteLanguageList[]
SiteLanguageList[]=fre-FR
SiteLanguageList[]=eng-US
ShowUntranslatedObjects=disabled
TextTranslation=enabled| Setting | What it does |
|---|---|
SiteLanguageList[] | the content languages shown, most preferred first; the empty first line clears inherited values |
ShowUntranslatedObjects | disabled: objects in none of the languages are hidden unless always available |
ContentObjectLocale | default language for new content created in this siteaccess |
Locale | interface language and date and number formats |
TextTranslation | enabled to translate interface texts into Locale |
Do not change ContentObjectLocale on a site with content without reading the warning in settings/site.ini.
Step by step
- Add the content language (see "Adding a content language").
- Copy
settings/siteaccess/sitetosettings/siteaccess/site_frand set the block above. - In
settings/override/site.ini.append.phpaddsite_frto[SiteAccessSettings] AvailableSiteAccessList[]andRelatedSiteAccessList[], and set up matching by path or host (see "Language addresses: path or host"). - Clear the caches:
php bin/php/ezcache.php --clear-tag=ini,content, and./console exp:velocity cache clear --applywhen Velocity serves the site. - Translate, starting with the front page and the menu.
Sharing the look of the main site
A translation siteaccess that should look exactly like the main site gets
[SiteAccessSettings] ExtensionSettingsSiteAccess=<main siteaccess>, so the design extension's settings for the main
siteaccess apply (Translations and languages).
Give each siteaccess its own SiteName in the language.
Checking
Setup > Languages shows, below the language cards, every siteaccess of AvailableSiteAccessList with its
SiteLanguageList in order; a locale that is not a content language is marked in red. Open the new address signed
out and check a translated and an untranslated page.
Related pages
- Building a multilingual site
- 10.14 Multi-language sites
- Extension loading order
- 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.