Drupal is one of the most popular web CMS (Content Management System) among PHP developers. The new latest released version Drupal 8 is getting more popular and most demanded for its new features added as part of the core platform (for eg. views become part of Drupal 8 core). It also provides better support for multilingual and globalization.
Drupal 8 provides most of the functionality required to build a multi-lingual site by its four modules as part of its core platform. These modules provide the interfaces to easily add languages and to translate content and user interface into different languages.
Add Translation Filter for multilingual functionality in view settings:
When we create blocks and pages using views with default settings display content in the default language (selected during installation). In multilingual sites, the same content is translated into multiple languages, so there are multiple translated versions of content stored in the database. Drupal provides filters which can be used to filter, and display the content added in a specific language. Without the use of these filters the view pages render the same content added in all languages irrespective of the selected language.
Let’s see this with an example below “problem statement”:
The above image shows an example in which we added content in two languages (English and Hindi) and creates a page using a view to show the list of recently added content. We also add language switcher in the left sidebar to display content in the selected language. As we can see that currently English is selected, but the page displays the same content in both English and Hindi language, to get rid of this issue follow the below steps.
How to apply translation filters with the view to filter multilingual content?
Drupal provides different filters for applying filtering of content on the basis of different conditions. We can easily resolve the above issue by applying translation filters on “views“. Below are the steps to add and apply filters to view in Drupal 8:
Step 1: In view interface, click on ADD button to add new filters
Lets continue the Reading here>> Apply Translation Filters in Drupal 8 for Multilingual Website