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
- Configuration Translation.
- Content Translation.
- Interface Translation.
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.
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.
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.
- Selected Language.
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.
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.