Thumbnail

Configuring a Drupal 8 Multilingual site

Thumbnail

Campbell Tilley

|

An easy step-by-step guide to configure multilingual content in a Drupal 8 site.

Install the Language and Content Translation modules

The first step in making your site multilingual is to install the required modules.

Navigate to the extend page and select the Language and Content Translation modules, which can be found under the Multilingual bundle, then click Install.

Modules.png

Add a new language

After the modules have been installed, we can add the required new language(s) to the site.

Navigate to Configuration > Regional and language > Languages then select + Add language. Use the drop-down select list and either search or scroll down to select the new language then click Add language.

After you have added the new language, it will be visible in the languages list. You can add more languages to the list if required.

Language list.png

Language detection and selection

We have our new languages installed on our site, now we need to configure how the languages are detected and selected.

Navigate to Configuration > Regional and language > Languages > Detection and selection. As a minimum, you should have Selected language and URL selected. These options will allow both URL detection and selection through the language switcher block.

You can select more options here such as the User which selects the language based on the users preference or Browser which selects the language based on the users browser language settings.

Detection and selection.png

Configure fields to be translated

Before we begin translating content, we need to configure the fields that will be translated. 

Navigate to Configuration > Regional and language > Content language and select Content from the Custom language settings list.

Your content types will appear below. Click on each content type you would like to translate. The translatable fields will appear.. By default they will all be selected, however, a lot of the fields don't need to be translated for most content types. Unselect all the fields that you don't want translated. I suggest having text fields selected only, such as Title, Summary and Body.

Note: if you are translating Paragraphs don't select the paragraph reference field on the content type, instead select Paragraph from the Custom language settings list then select the fields to be translated underneath each paragraph type.

Translate content

Our site is now configured and we are ready to translate content.

Navigate to the edit page of an existing node then select Translate from the Tabs section. The English translation of the node is at the top of the list, followed by the new languages that have been added to the site. Click Add on the language below English and then begin filling in the fields. You will only be able to see the fields that you had selected in the previous step. Once you have finished, save the node.

On the Translate page, you will now see that you have a node in two languages. Continue adding translations to your other nodes as required.

Translation.png

Add new comment

The content of this field is kept private and will not be shown publicly.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.

Comments

  • Allowed HTML tags: <em> <strong> <cite> <blockquote cite> <ul type> <ol start type> <li> <dl> <dt> <dd> <p>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
  • Use [gist:#####] where ##### is your gist number to embed the gist
    You may also include a specific file within a multi-file gist with [gist:####:my_file].

Spread the word