01
About
The Language module allows you to configure the languages used on your site, and provides information for the Content Translation, Interface Translation, and Configuration Translation modules, if they are enabled. For more information, see the online documentation for the Language module.
Uses
- Adding languages
- You can add languages on the Languages page by selecting Add language and choosing a language from the drop-down menu. This language is then displayed in the languages list, where it can be configured further. If the Interface translation module is enabled, and the translation server is set as a translation source, then the interface translation for this language is automatically downloaded as well.
- Adding custom languages
- You can add a language that is not provided in the drop-down list by choosing Custom language at the end of the list. You then have to configure its language code, name, and direction in the form provided.
- Configuring content languages
- By default, content is created in the site's default language and no language selector is displayed on content creation pages. On the Content language page you can customize the language configuration for any supported content entity on your site (for example for content types or menu links). After choosing an entity, you are provided with a drop-down menu to set the default language and a check-box to display language selectors.
- Adding a language switcher block
- If the Block module is enabled, then you can add a language switcher block on the Block layout page to allow users to switch between languages.
- Making a block visible per language
- If the Block module is enabled, then the Language module allows you to set the visibility of a block based on selected languages on the Block layout page.
- Choosing user languages
- Users can choose a Site language on their profile page. This language is used for email messages, and can be used by modules to determine a user's language. It can also be used for interface text, if the User method is enabled as a Detection and selection method (see below). Administrative users can choose a separate Administration pages language for the interface text on administration pages. This configuration is only available on the user's profile page if the Account administration pages method is enabled (see below).
- Language detection and selection
- The Detection and selection page provides several methods for deciding which language is used for displaying interface text. When a method detects and selects an interface language, then the following methods in the list are not applied. You can order them by importance, with your preferred method at the top of the list, followed by one or several fall-back methods.
- URL sets the interface language based on a path prefix or domain (for example specifying de for German would result in URLs like example.com/de/contact). The default language does not require a path prefix, but can have one assigned as well. If the language detection is done by domain name, a domain needs to be specified for each language.
- Session determines the interface language from a request or session parameter (for example example.com?language=de would set the interface language to German based on the use of de as the language parameter).
- User follows the language configuration set on the user's profile page.
- Browser sets the interface language based on the browser's language settings. Since browsers use different language codes to refer to the same languages, you can add and edit languages codes to map the browser language codes to the language codes used on your site.
- Account administration pages follows the configuration set as Administration pages language on the profile page of an administrative user. This method is similar to the User method, but only sets the interface text language on administration pages, independent of the interface text language on other pages.
- Selected language allows you to specify the site's default language or a specific language as the fall-back language. This method should be listed last.