By Gábor Hojtsy , 17 July, 2013

Up to date as of October 16th, 2015.

We went through most of the great new base language features in Drupal 8, but one thing that was not yet covered is built-in transliteration support. Yes, you read that right. Drupal 8 includes a powerful backend system for transliteration and it even uses it for machine name generation on the frontend.

Here are a few examples on how Drupal prefills the machine name for a content type for a Hungarian, Czech and Marathi type respectively:

Image
Image
Image

You don't even need to have language module enabled to use the transliteration services. However language specific transliteration patterns are supported, and the overrides are alterable. See https://drupal.org/node/1842748 for documentation on how to tap into this new API.

While this concludes the list of new base language features, that is only one of the language related modules in core. The tidbits are far from over! Excited about Drupal 8 yet?

Issues to work on

By Gábor Hojtsy , 12 July, 2013

We just had a full-on week of sprinting in Dublin at Drupal Dev Days recently. I think we had the biggest group and have been actively recruiting more people as they came in. The photograph below shows people gathering for the initiative meeting we had in-person. Of course this is just a small part of the whole team, which is at last count over 800 people who participated on at least one issue!

Image

John Heaven made a series of videos about what's exciting in Drupal 8 as well as where people made progress in Dublin (below) and what is still to be done (to be published). Looks like I am not the only one who noticed the great results of the team! I'm really proud of all the amazing things we moved forward from the entity translation API all through cron support for localization downloads, major improvements to the internals of configuration translation and removing eval() from locale module!

Drupal 8 is shaping up to be outstanding for multilingual sites! I can't wait.

By Gábor Hojtsy , 9 July, 2013

Up to date as of October 16th, 2015.

Once you have detailed language information on content, configuration, etc, which is now widely possible in Drupal 8 (see the tidbit on language assignment), you can use this data to pull out content for specific languages.

Everything is in blocks now

While not a multilingual change, it is hugely useful for multilingual use cases that everything is in blocks now. The page title, branding, breadcrumbs, menus, navigation tabs, and so on. This make it possible to customize page content much easier using the blocks controls, effectively giving site builders all the powers around page content.

Block visibility

Brand new in Drupal 8 are language visibility conditions for blocks provided by Language module. This combined with everything being a block allows you to swap out menus per language or localize the branding of the site.

Image

This option is made available if you have more than one configured language on your website. While prior versions of Drupal provided visibility settings based on user roles, content types, paths, etc. this is now expanded to languages too. Here you can pick specific languages, even multiple of them (applying in an or relation).

By Gábor Hojtsy , 2 July, 2013

Up to date as of October 16th, 2015.

One of the strongly supported language features of Drupal is right to left (RTL) language support. For some Drupal core versions, introducing an RTL language on the site is easy. Language settings include the choice of left to right and right to left orientation per language. This is still the same in Drupal 8.

There are two notable improvements though. Language settings being at the front of the installer, we have clean support for right to left orientation from picking the install profile even:

Image

Also, Drupal 6 and 7 had a special solution for writing right to left CSS. For any CSS file in the system (file.css), you could have an RTL counterpart (file-rtl.css) that was automatically added to the page when needed. This was a Drupalism and browsers got much better at supporting attribute selectors in the past years, so now the right to left CSS is all integrated in the actual CSS files. You should now use attribute selectors such as [dir="rtl"] to target specific parts of the CSS at RTL displays. By keeping the right to left styles close to the base CSS, there is less chance for mistakes and missing or out of sync RTL styling, so we hope this will result in even better RTL support!

See https://drupal.org/node/2032405 for more information and code examples.

Issues to work on

  • DONE! Ok, ok, I cheated a bit with the above screenshot. There is still a bug with the sidebar position of the installer in RTL. See https://drupal.org/node/2033137 - should be an easy one to fix though
  • One more thing that you may notice on the screenshot is that even English text got the RTL treatment in terms of the placement of the end of sentence period. This is not a very easy problem to resolve. An issue is going for over two years at https://drupal.org/node/1165476 to resolve this by printing additional language and direction information in this case, so the browser knows which parts are not in the (RTL) language requested. This would be useful for left to right settings also to mark the language of parts that are untranslated. Creative ideas welcome!
  • There still may be missing RTL styles, especially on the administration interface. See https://www.drupal.org/node/2359331 for a collection of issues dealing with the situation.
By Gábor Hojtsy , 21 June, 2013

Up to date as of October 16th, 2015

As we touched on in the detection options tidbit and when talking about language configuration, the site default language used to be a very key (and higly dangerous to change) setting, because all the things that were in an unspecified language were assumed to be in that language. In Drupal 8, one of our most important goals was to make everything know its language as far and wide as possible.

Extensible special languages

Not everything can have a language even if it has a language property. Drupal 7 has one special language, Language neutral for these cases. This "language" is assigned to content which is not specifically in a language. People also used this to designate when the language was not known but some language needed to be assigned later. In Drupal 8, these two roles are separated into "Not applicable" and "Not specified" respectively. Also, these two special languages are stored as configuration with the other administrator configured languages (but are not shown on the configuration page to avoid confusion). Modules and distributions can add more special languages like these easily. These are locked (cannot be edited or removed), and when shown in a language list, they show after the manually configurable languages.

By Gábor Hojtsy , 19 June, 2013

Up to date as of October 16th, 2015.

Once/if you have multiple languages configured on your website, selecting from them for the page becomes an important question. The Drupal 8 language detection and selection options are located the same place they were in Drupal 7 but almost all options got some improvement.

Useful out of the box

Drupal 7 only had the default language detection method turned on, so even if you kept adding in more and more languages (and even if you enabled the language switcher block), the URLs did not work. You still needed to get here and configure the URL detection method. Now this is built-in, so adding languages and placing a selector block would in itself make multiple languages accessible.

Image
By Gábor Hojtsy , 17 June, 2013

Up to date as of October 16th, 2015.

As I've outlined in the previous post Drupal 8 core now has 4 core modules to deal with language support. This tidbit will be about the simple language setup features provided by Language module, which is the base for every other language feature.

Image

Language module provides a simple language overview screen. You can reorder existing languages, remove languages (except the site default language, which on the screenshot is English) and add new languages. It is not anymore possible to have enabled and disabled languages on your site. This feature resulted in a confusing mess where some places and permission combinations allowed for the use of disabled languages and it was used as a means to stage certain new content. Just use proven content staging techniques (or unpublished posts) for new language content.

By Gábor Hojtsy , 12 June, 2013

Up to date as of October 16th, 2015.

Once you install Drupal 8 in a foreign language, you'll have Language and Interface translation modules enabled with the chosen language configured. Drupal 8 has more core modules handling language related features, yet less requirement for contributed modules to be installed for the most important tasks (on my last count, the 4 modules explained here cover functionality of 20+ modules from Drupal 7 and in much better ways).

Why have multiple modules when a multilingual site just needs all the features? Well, there are also foreign language (not multilingual) sites that we aim to support better and multilingual sites can be very different as well. Also, admittedly there are technological reasons to organize the modules by the features they provide.

In Drupal 8 multilingual is one of the groups of core modules, so you'll find these modules under the main core modules in a neat group.

Image
By Gábor Hojtsy , 11 June, 2013

Up to date as of October 16th, 2015.

Starting a new series

The Drupal 8 Multilingual Initiative was announced on May 9th, 2011. Since it's inception, the heroic efforts of people on the initiative resulted in hundreds of issues resolved but there are always more to perfect. We have made huge advances in terms of multilingual support in Drupal 8 thanks to all these changes and you can still help to make it perfect.

I'd love to highlight some of the great improvements that we made to make you excited about what is coming and point out some related places where you can still help to perfect what we have so far. This is number one in a series of short posts to discuss these improvements.

Language first in the installer

Drupal 8 makes language occupy the prominent first step in the installer. And compared to Drupal 7 where you were presented with a wall of textual instructions as to how to locate and download a translation file, place into a specific directory and reload the page, Drupal 8 comes with the realization that these are all tasks we can automate. So we show you about a 100 languages to choose from to install Drupal 8 in.

Image

The new Drupal version also comes with highly improved browser based language detection capabilities, so it will attempt to automatically identify your preferred language for this installation based on what your browser tells us. So in most cases, you'll likely just hit the button to continue and not think much about this.

We not only present you with the list of languages, we also download and import the translations to your system proper. So all the steps you did manually before are now automated. The installer can also fully show up in right to left languages.

Image

Also, if you pick a foreign language here, English will not be among your site's languages anymore either. Drupal 8's assumption is that if you install in a foreign language, you likely want a foreign language website without English showing up at all kinds of places as an option. Compared to Drupal 7 where English was not possible to remove.

By Gábor Hojtsy , 30 May, 2013

I've had the pleasure to present the current state of the Drupal 8 Multilingual Initiative - great work of numerous highly respected individuals - just last week in Portland at DrupalCon Portland 2013. Although I did do live demos at previous editions of this session, at this point we have just too many great improvements, that it does not fit anymore. So for this session, I opted to provide a better overview and more context as to how this affects site building in general for Drupal 8, including the extent of change as it applies to contributed modules.

We are still working on several key pieces of the initiative, and will have meetings every Wednesday leading up to the code freeze coming July 1st, 2013. Join on our meetings to help with the remaining tasks. We have tasks for all experience levels!

Download the slides from https://portland2013.drupal.org/sites/default/files/slides/D8MI-Portlan…