Drupal 8 multilingual site set up

09 Nov 2017
Drupal 8 Multilingual

Today, we will see Drupal 8 Multilingual site set up. Unlike previous versions of Drupal, Drupal 8 has 4 modules in core, which will enable multilingual functionality. To enable these modules, you'll need to go to the "Extend" administration page. 

Drupal 8 Multilingual Modules

  1. Configuration Translation.
  2. Content Translation.
  3. Interface Translation.
  4. Language.

Enable all these modules and it will enable the multilingual capability next we will configure the settings to actually see Drupal 8 multilingual functionality in action.

  1. Multilingual Modules

Translating site interfaces

Go to Configuration >> Regional and language >> Language. Add new Language, Drupal supports many languages out of the box. Which can be used for translation.

Add Language

Now, download language file (.po) from https://localize.drupal.org/ and import it to /admin/config/regional/translate/import Configuration >> Regional and language >> User interface translation. You can manually add translations for words as all the words didn't get translated with the file.

Now set the language detection method. Go to "/admin/config/regional/language/detection" and choose one of the option available in the list.

  1. URL.
  2. Session.
  3. User.
  4. Browser.
  5. Selected Language.

Language Detection

Choose one option and save the configuration.

Enable content translation

Go to Configuration > Content language and translation (admin/config/regional/content-language) and select the content and fields which needs to be translated.

Enable Translation

After saving these configurations. Create content and you will find "Translate" tab while editing the content. This way you can add content for all the languages you want. In Drupal 8 multilingual set up content with each language shares the same nid, whereas in Drupal 7 each translation comes with new nid. 

Go to Blocks and place a block "languageswitcher" to any region, it will provide list of available languages. And by clicking any of the language user can access the content of that language. This way Drupal 8 multilingual functionality is done.