Configuring the site languages
Which content languages a siteaccess shows, and in which order of preference, is set per siteaccess in site.ini.append.php in settings/siteaccess/<siteaccess>/, group [RegionalSettings].
| Setting | What it does |
|---|---|
| SiteLanguageList[] | The content languages this siteaccess shows, most preferred first. An object is shown in the first of them it has. Empty: only ContentObjectLocale is shown. |
| ShowUntranslatedObjects | disabled (shipped): objects in none of those languages are hidden, unless always available. enabled: they are shown in their main language. |
| ContentObjectLocale | The default language for new content; shipped as eng-US. |
| ContentObjectFallbackLocale | The last resort while no content language is set at all, for example while the setup wizard creates classes; shipped as eng-US. |
| Locale, TextTranslation | The interface language and the formats of dates and numbers; see Configuring your site locale. |
What the setup wizard writes
The setup wizard asks for the languages of the new site and which of them is the default. It adds them as content languages and writes them to the public and the administration siteaccess: Locale and ContentObjectLocale from the default language, SiteLanguageList[] with the default language first. For the administration siteaccess it also writes ShowUntranslatedObjects=enabled, so that editors can work with content in every language, also those the public site does not show. With British English as the default and French and Norwegian added, the public siteaccess gets:
[RegionalSettings] Locale=eng-GB ContentObjectLocale=eng-GB SiteLanguageList[] SiteLanguageList[]=eng-GB SiteLanguageList[]=fre-FR SiteLanguageList[]=nor-NO TextTranslation=disabled
TextTranslation is written disabled when the default locale is eng-GB, the language the interface texts are written in, and enabled otherwise.
Changing the order
Reorder the lines of SiteLanguageList[]. With English, French, German and Norwegian listed in that order, an article in French and Norwegian is shown in French. Move Norwegian to the top and the same article is shown in Norwegian. Start the list with an empty SiteLanguageList[] line, so that the siteaccess has exactly the languages you list and none from settings/site.ini or an override.
After changing the list, clear the INI and content caches:
php bin/php/ezcache.php --clear-tag=ini php bin/php/ezcache.php --clear-tag=content
One siteaccess per language
A multi-language site usually has one public siteaccess per language, matched by a part of the address (/fr/) or a host name, all sharing one database and listed in [SiteAccessSettings] RelatedSiteAccessList[]:
| Siteaccess | SiteLanguageList[] | Shows |
|---|---|---|
| gb | eng-GB | English content only |
| fr | fre-FR, eng-GB | French content, English where there is no French |
| no | nor-NO, eng-GB | Norwegian content, English where there is no Norwegian |
An article only in English is shown on all three. An article only in French is shown on fr only. Translate it into English and it appears on gb and no as well. The language switcher builds links between the siteaccesses.
Adding a language later
Add the content language under Setup > Languages (see Managing the translation languages). Adding it changes no siteaccess: list it in the SiteLanguageList[] of each siteaccess that should show it, or create a siteaccess for it. The administration siteaccess, with ShowUntranslatedObjects=enabled, offers the new language for editing at once.
More
- Content languages, section 5.
- Content language fallback.
Contributors
- Geir Arne Waaler Maintainer
- Andrea Melo Maintainer
- John Commenter
- Farzad Commenter
- Graham Brookins Updated Maintainer
Comments (2 historical)
Written by readers of the earlier documentation sites, kept as they were.
Languages limits
John ·
Is there a limit on how many languages you can setup? Also, can they cause any trouble?
Thanks anyway for the clear explanation!
_______________________
http://www.ufpsp.com/
add a new languages
Farzad ·
Hallo,
how can I add a new language such as Arabic or Persian?
Thank´s