Multi-language (11403666)
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
- Configuring the site languages and Configuring your site locale.
- Managing the translation languages, Multi-lingual objects and Working with translations.
- Language-based permissions.
- Translatable class attributes and Translatable country names.
- The bit-field algorithm: how languages are stored.
- Language switcher: links between the language versions of a page.
More
- Content languages: adding, showing, translating and removing them.
- Languages in Exponential: every locale and administration translation.
- Translations and languages and right-to-left languages.
In this section
- Configuring your site locale Configuring the locale of a siteaccess: Locale and TextTranslation, the shipped locales, variations, custom locales and translation fallbacks.
- Configuring the site languages Configuring the site languages: SiteLanguageList, ShowUntranslatedObjects, ContentObjectLocale, what the setup wizard writes, one siteaccess per language.
- Managing the translation languages Setup > Languages: the content languages page, adding and removing languages, and the limit of 62 languages.
- Translatable class attributes Translating class names, descriptions and attribute names: creating, translating and editing classes in several languages.
- Translatable country names Translated country names from the [CountryNames] group of the locale, and changing them with a locale variation.
- Multi-lingual objects Creating objects in a language, the Translations window, main language, always available and the default availability of a class.
- Working with translations Editing, adding and removing translations of objects in the administration, and moving content to another language.
- The bit-field algorithm How Exponential stores languages as bits: language IDs, language_mask, initial_language_id and filtering by language.
- Language-based permissions Language limitations of content policies: create, edit, publish, translate and hide, with a translator role example.
- Showing Translations / Multi-language / Features / 6.x / ... Exponential Documentation
Contributors
- Geir Arne Waaler Maintainer
- André Rømcke Maintainer
- Ricardo Correia Maintainer
- Jose Felipe Commenter
- Claudia Kosny Commenter
- Ferenc Csurgai Commenter
- Graham Brookins Updated Maintainer
Comments (3 historical)
Written by readers of the earlier documentation sites, kept as they were.
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.
Re: Showing Translations
Claudia Kosny ·
Hello Jose
Next time please post your question in the forum - the chances for an answer are much better there. Regarding the language bar check this link
http://ez.no/community/articles/n...and_displaying_multi_lingual_content
Claudia
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