Skip to the content
Documentation

Multi-language (11403666)

No ratings yet

Exponential stores content in several languages at once. Every object can have one translation per content language; there is no main language that every object must have. One article can exist only in English, another only in German, a third in both. Each siteaccess decides which languages it shows, and in which order of preference.

Two kinds of language are set in different places and are independent of each other:

  Content language Interface language
What it is A language objects are written in The language of buttons, menus and messages of the templates
Where the texts are In the database, one translation per object and language In .ts translation files of the kernel and the extensions
Managed in Setup > Languages (content/translations) site.ini [RegionalSettings] Locale and TextTranslation
Chosen for a page by SiteLanguageList[] of the siteaccess Locale of the siteaccess

The terms

  • Locale: a set of country-specific settings (language, date and time format, number and currency format, names of months and days, country names), one file per locale in share/locale/, named like eng-US.ini or ger-DE.ini: three letters for the language (ISO 639-2), two for the country (ISO 3166-1). See Configuring your site locale.
  • Translation languages (content languages): the languages content can be created and translated in, added under Setup > Languages. An installation holds at most 62 of them on 64-bit PHP (30 on 32-bit PHP). See Managing the translation languages.
  • Site languages: the prioritized list of content languages a siteaccess shows, [RegionalSettings] SiteLanguageList[]. An object is shown in the first of these languages it has; objects in none of them are hidden. See Configuring the site languages.
  • Default language: [RegionalSettings] ContentObjectLocale, the language new content is created in when nothing else is chosen, and the language PHP code uses when it does not name one. Shipped as eng-US. Do not change it on a site that has content without reading the warning in settings/site.ini.
  • Main language (initial language): the language an object was created in, or the one an editor chose later. It cannot be removed from the object while it is the main one. The code and the database call it "initial language"; the administration interface calls it "main language".
  • Always available: a flag per object. An always-available object is shown in its main language on a siteaccess that lists none of its languages. Folders and users usually have it, so that, for example, a German siteaccess still finds the English user who wrote an article. See Multi-lingual objects.

Example

The content languages are English, French and Norwegian. The public siteaccess lists English, then French:

# settings/siteaccess/site/site.ini.append.php
[RegionalSettings]
SiteLanguageList[]
SiteLanguageList[]=eng-GB
SiteLanguageList[]=fre-FR

An article in English and French is shown in English. An article only in French is shown in French. An article only in Norwegian is not shown, unless it is always available or ShowUntranslatedObjects=enabled.

The pages of this section

More

In this section

Contributors

Comments (3 historical)

Written by readers of the earlier documentation sites, kept as they were.

  1. Showing Translations

    Jose Felipe ·

    Even though I followed all the steps in the installation, and created the pages translated from the original language I am still unable to see them on the site. Only one language is shown.
    Does anyone know how to DISPLAY a LANGUAGE BAR alike the one seen on the EZ Systems SITE.

  2. Default object name

    Ferenc Csurgai ·

    Hi,
    When a user try to create a new object (forum topic) on a Hungarian page, the default object name will be "New Fórum Téma" instead of "Új Fórum Téma" or "New Forum Topic". The Initial/Main language is Hungarian, the class also has a Hungarian translation, but the generated object name isn't correct. How can I fix it?
    Regards,
    Csurgi

Comments

Add a comment

Comments are read by a moderator before they appear.