Internationalization and Languages

Even though there have been great advancements across the board, Drupal 8 has a couple of almost revolutionary developments compared to its predecessor. Notable among these are the configuration API and the caching system, which are both lightyears ahead of what was capable in Drupal 7. Another one is the multilingual initiative that sought to make Drupal fully multilingual out of the box, rather than having to use 20 contributed modules to achieve results that don't even come close. This also includes the internationalization (i18n: https://www.w3.org/standards/webdesign/i18n) aspect that allows sites to be translated into any of the installed languages.

In this chapter, we are going to talk about internationalization and multilingual features in Drupal 8 from the point of view of a module developer. Many of the built-in capabilities of this system are oriented toward site builders—enabling languages, translating content and configuration entities, as well as the Drupal interface (for administrators and visitors alike). Our focus will be what we as module developers need to do programmatically to ensure that site builders and editors can use the aforementioned features. To that end, this chapter will be more of a reference guide with various tips, techniques, and even rules we need to follow when writing our code. Notwithstanding, we will also talk a bit about how we can work with languages programmatically.

First, however, we will start with an introduction to the multilingual ecosystem that comes out of the box and the modules responsible for various parts of it.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset