Want an easy way to extend your market reach and ultimately your sales? Do you feel you need to personalize your website to every user no matter which country they belong to or what language they speak? Getting yourself a multilingual website is your best bet. Not only is it a more cost-effective marketing strategy, but it also helps in increasing your website traffic and overall Drupal SEO. Drupal CMS has particularly taken up this challenge of providing not only users but also developers with the ability to access Drupal in a language that they prefer. And with Drupal 8 being multilingual out-of-the-box, it has become an ideal choice for businesses and developers. Powerful Drupal translation modules offer developers with granular configuration capabilities where every content entity can be translated. Let's dive right in to learn more about the various multilingual Drupal modules.
What are Multilingual Websites?
Multilingual basically means written or available in different languages. Multilingual websites connect better with users from different countries as it immediately adds an element of familiarity. Drupal 8 provides an easy and a great experience of building a drupal multilingual website. Currently, Drupal 8 supports 100 different languages for translation.
Drupal 8 multilingual features come along with the installation interfaces. As soon as you install Drupal, based on the browser preference, it provides a language for your Drupal website. Based on the option selected the site is installed in that particular language. It basically provides 4 different Drupal translation modules for language and content translation. We can enable the required Drupal modules on our site and use it according to our requirements.
The four core Drupal translation modules available :
- Language module
- Content translation module
- Interface translation module
- Configuration translation module
Let’s catch up with what each drupal translation module does, its configurations and how each module can be used in our Drupal website.
Firstly, you need to enable all the 4 core modules in your drupal site. All the drupal translation modules can be configured at path /admin/config/regional
Drupal Language Module
This Drupal 8 language module is one of the core modules located at core/modules/language. It provides a feature of adding and choosing a new language to your Drupal website. Under /admin/config/regional/language/ you can simply add a new language to your site by clicking on the “Add Language” button. The Drupal multi language module provides a list of different languages from which you can choose the language you need for the development.
Choose the preferred language from the list and add it
Once the language is added the interface will look similar to this (refer image above). In the above picture, the default language of the interface is set as English and Spanish is the additional language installed. The 9172/9340(98.2%) under Interface translation indicates that 9172 words out of 9340 words available for translation are translated i.e 98.2% of the words in the interface are translated.
It also provides a block( Drupal 8 Language switcher) to switch the language from one to another which can be placed at any region of your Drupal website. Under /admin/structure/block we can place the Drupal 8 language switcher block with which we can switch the default language of our website.
Once the block is placed in the region we will be able to switch to the different languages in the web page itself.
Content Translation Module
This Drupal Translation module allows you to translate content entities such as comments, custom block, contents, taxonomy terms, users etc. In order to translate the content entities, the website should have at least two languages installed. The content translation can be configured at path admin/config/regional/content-language . It provides a list of entity types which can be translated.
For example, click on the content configuration option that appears for each content type.
Let us consider that the content translation is being enabled for the article content type. It provides an option to decide if each subtype entity to be translatable or not. We can also change the default language for a particular content type. Each field has an option to translate its content or not.
The Drupal translation modules also provides an option to input the content in the language which is suitable for the user while adding content from the backend interface. Once the above configuration is set up and when we try to add content to the Article content type we can see a Select option with the languages installed in our site. We can select any language and add content in the particular language selected.
Once the content is saved, users with translate permissions will see links to Translate their content. It provides an additional tab called “Translate” along with the "Edit" links, and you'll be able to add translations for each configured language.
Interface Translation Module
The Drupal Interface translation module is also a part of the core module and can be easily enabled like any other Drupal Translation module. Once this Drupal 8 multilingual module is enabled, it is possible to replace any string in the interface with a string that has been customized. Whenever this drupal translation module encounters any string, it tries to translate the particular string to the current language of the interface. If a particular translation is not available it is remembered and we can look up into the untranslated string in the table.
In the above example, the strings which are both translated and untranslated are displayed and we are able to modify the strings for the language that is installed as well. The drupal translations for the strings are put up in a single place called http://localize.drupal.org and the Localization Update module will automatically import the updated translation strings for your selected language. In Drupal 7 and previous versions, this was a contributed module. In Drupal 8 however, this multilingual Drupal module is a part of the core.
Drupal ConfigurationTranslation Module
The Configuration Drupal 8 Translation module allows configuration to be translated into different languages. The site name, views name, and other configurations can be translated easily using this Drupal multi language module.
It also provides an option to input the content in the language which is suitable for the user while adding content from the backend interface. Once the above configuration is set up and when we try to add content to the Article content type we can see a Select option with the languages installed in our site. We can select any language and add content in the particular language selected.