Configuring the web application for multilingual websites

Configure Tridion Sites Publications to function as a multilingual website, which displays a language selector drop-down list that enables users to select the language.

Before you begin

The installation process for DXA uses your inputs to set up your environments in Topology Manager and Content Manager so that the DXA web application knows how map URL requests to the Example Site Publication. If you have based your multilingual website off of the provided Example Site, they you should be ready to proceed with the steps in this task to configure a multilingual website.

As an extra measure, you can also check the following two things before proceeding with this task:

  • In Topology Manager, the Tridion Sites delivery infrastructure is properly configured (using the provided PowerShell scripts). Be sure that the website URL is defined as a Base URL.
  • In Content Manager, for each multilingual site's child Publication, there are Business Process Types defined and mapped to a configured Topology Type.

You can see the environments and their properties in the Topology Management user interface, available from the slide-out navigation screen in Content Manager Explorer. This interface provides a read-only view of your environments. You can modify (as well as view) the environment configuration using Topology Management PowerShell scripts.

Refer to the Tridion Sites product documentation for complete information on all the Topology Manager scripts and instructions for configuring your delivery infrastructure in Topology Manager.

Procedure

  1. In Tridion Sites, open the Content Explorer.
  2. For each Publication in the multilingual website's BluePrint, open the Properties and on the General tab, do the following:
    1. From the Metadata Schema list, select Publication Metadata.
      New settings appear for the metadata.
    2. Enter a value for the Site Identifier that uniquely identifies the entire multilingual website and represents all language versions of this website. The Site Identifier must be the same for all Publications that are part of the same, multilingual website.
    3. For the parent Publication, select the Yes checkbox to indicate it as the master Publication from which you will publish all HTML design assets. (Of all the Publications with the same Site Identifier, only one can be the master Publication.)
    4. For the Publication URL and Images URL fields, ensure that they do not include a preceding slash so that the URLs are obtained automatically from the Topology Manager configuration.

      While excluding the slash is not a requirement, we urge doing so as a best practice. The current DXA Example Site actually still includes the slash in the sample content; however, these will be updated in a future release.

    5. Once you have completed these steps for a Publication, click Save, but keep the properties window open.

    Example settings for a parent Publication in the base language:

    Example settings for a child Publication for the Dutch language:

  3. For each Publication, go now to the Publishing tab, and do the following:
    1. From the Business Process Type list, select a value, such as "DXA Staging/Live." These correspond to Topology Types that should have been previously configured in Topology Manager (through the DXA installation process).
    2. From the Enviroments list, select one of the available environments, such as " Staging." Each corresponds to a Purpose, also previously configured in Topology Manager.
    3. Select Add Mapping.
    4. From the Web site location list, select a website URL. These again should have been previously defined as Base URLs in Topology Manager.
    5. In the URL path segment field, enter a value as follows:
      • For the parent Publication, leave the field blank.
      • For child Publications, enter a text string that will use used as a segment in the website's URL. This can be anything, but it needs to result in a unique URL for the website. For a multilingual site, the typical practice is to use the standard language code, such as "nl" for the Dutch language.
      The Sites URLs section at the bottom of the page shows the complete URL for the website.
    6. Once you have completed these steps for a Publication, click Save and Close.

    The following illustrates the settings for a staging environment for the Dutch (child) website:

  4. In each language's Publication, localize and configure the Localization Configuration Component, as follows:
    1. Navigate to the /Building Blocks/Settings/Core/Site Manager/ Folder.
    2. Fine the Localization Configuration Component, and use the BluePrinting option to localize it.
    3. Open the localized Localization Configuration Component for editing. and set appropriate values set for:
    4. On the General tab, set appropriate values set for each of the following settings:
      culture
      Enter an ISO language code to set the formatting of culture-specific content, such as dates and time.
      Use the format aa-AA where:
      • aa is a two-letter language code
      • AA is an optional two-letter country code to specify a region
      For example, nl for Dutch generally without regard for region or nl-NL for Dutch specifically within Netherlands.
      language
      Enter the value that you want to appear for this language and in the website's language selector list, for example Nederlands for Dutch.

    The following Component configures the website for Dutch within the Netherlands:

  5. Publish the Publish Settings Page of all Publications in the multilingual website, that is the parent and child Publications for each language.

    The Publish Settings Page is located in the following Building Blocks folder: \PUBLICATION NAME\Home\_System

    Where PUBLICATION NAME is the name of the parent or child Publication.

  6. In IIS, recycle your website Application Pool.
    This action refreshes the web application's cache and reloads its settings.
  7. Open your website and verify that the language selector appears in the website header.

    The following example illustrates the list with two languages, the parent Publication's English and one child Publication in Nederlands (Dutch):

    The language selector will attempt to redirect you to the equivalent page in the selected language Publication. If this page does not exist, or is not published, it will redirect you to the language root URL, for example /nl.