Drupal 8 Multilingual Sprint report from Munich

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
Gábor Hojtsy's picture

It is already a week and a half since the DrupalCon Munich co-located sprint for the Drupal 8 Multilingual Initiative ended. It feels much less because most of last week was spent recovering and trying to lobby patches to get in. So it is now time to take a review of what we done and how we did.

It was a huge and active sprint starting three days before DrupalCon and ending three days after the DrupalCon sessions were over, covering the whole weekend before and after DrupalCon and including sprinting on the DrupalCon training day and the official sprint day. The biggest crowd gathered for the official DrupalCon sprint day with an astonishing four full tables for our sprint only with even more individuals sprinting at other tables. I think this was the biggest Drupal multilingual sprint ever. It was both great to get days in both before and after DrupalCon and hugely tiring. I personally struggled all week after DrupalCon to get my speed back.

Thanks to everyone involved!

First off, a sprint on this scale would not be possible without sponsors and significant on-site help. DrupalCon provided us with space on Monday and Friday, and some great food on Friday. The rest of the days would not have been doable without comm-press, dotProjects.be, Open8.se, OSINet and Acquia. The various amounts of financial sponsorships they provided paid for our weekend venue, soft drinks, sandwiches, ice cream, fruits and so on. Evolving Web sponsored DrupalCon tickets for various key contributors. Among the sprinters, Amazee Labs sent four of their developers for all days of the sprint! psegno.it also had both of their developers on site, who made great progress with key improvements. We also had Wizzlern, MD Systems and others contributing very valuable developer time. We even had a surprise dinner sponsorship from Capgemini. Christian López Espínola could not come to Munich, but decided to organize a sprint local in Sevilla, plugging in to the Munich sprint remotely, leading new people to fix multilingual issues there in person. If you need a multilingual project done, now you know where to look for experts!

Last but definitely not least, thanks for the huge help to the local organizers, especially Florian Klare and Stephan Luckow. They helped us manage collecting and spending sponsor money wisely with the Drupal Initiative e.V, prepared great sandwiches and fruit plates for us and even organized a sprinter party night with grill food. It was amazing to work with such helpful and flexible local organizers.

Key results already landed in Drupal 8

Multilingual values for configuration are now loadable in CMI

We introduced config events and listeners in the config system with generic overrides. We ported the $conf array handling to use this generic override system and added language specific overrides as a possibility. We still need many details worked out before this gets useful (eg. we don't actually write language specific files yet and we don't have a 'context' system to properly retrieve the right values when needed): http://drupal.org/node/1646580

Entity form controller classes introduced

To make it possible to reuse the entity forms for all language variants of the entity, we introduced entity form controllers (and OOP callback possibility for form submission and validation as a side effect): See http://drupal.org/node/1499596

More granular translation permissions

To align with the regular node access permissions, we renamed "Translate content" to "Translate all content" and introduced the "Translate own content" permission: http://drupal.org/node/253157

Core search got a lot more language functionality

Although entity/field translation was introduced in Drupal 7, no search module support was built for it. We plugged this hole by indexing language variants of entities as their own items with search module: http://drupal.org/node/1669876

Now that we have more granular information about language in search module, we also made it possible for stemmer and other search preprocessors to get language information, so it is now easier than ever to plug in language specific preprocessing: http://drupal.org/node/511594

Language selector on taxonomy terms, vocabularies, new language_select formAPI element

It has never been easier to provide a language selector on your forms. If the language module is not enabled, the selector falls back to be a value type field, so the language you set is preserved. If the language module is enabled, a dropdown is displayed. We also introduced language selectors on taxonomy terms and vocabularies with this field: http://drupal.org/node/1280996

Ported the admin_language module to core!

We introduced a new administration user interface language option, which was a common request for sites with multiple languages, so you can go in and fix things in a language you know even if the issue is with a node in a different language: http://drupal.org/node/322995

Big Gettext .po files are now imported in batches

Whether Drupal imports a .po file either from the upload form or when you install modules or themes, Drupal now goes into a batch process to import chunks of the file instead of the whole file at once. This allows the import to provide continuos feedback and more importantly for low resource sites to not time out when importing a big translation file. http://drupal.org/node/1637348

Now collecting project information for translation updates

We are not yet there to actually download .po files for your modules, but we got the integration of update module information with locale requirements in core. Now we can keep track of the module versions you have so we'll be able to download (new) translations when needed. http://drupal.org/node/1627006

Smaller changes in Drupal 8 and 7

Other changes include a simplified API for tokens to get language information (http://drupal.org/node/1305378), better documentation on the current process to install Drupal in foreign languages (http://drupal.org/node/1392208), replacing term label references with a method call to support multilingual use (http://drupal.org/node/1616972 and http://drupal.org/node/1642070), better language negotiation setup for foreign language installs (http://drupal.org/node/1738330), universally using the Language object when creating and saving languages (http://drupal.org/node/1739994) and better PostgreSQL support in language_list() (http://drupal.org/node/1741068).

We also made some small usability improvements, cleaning up names and descriptions for language negotiation settings (http://drupal.org/node/1756122), adding support to auto-detect the lanuage of an imported .po file on the user interface (http://drupal.org/node/1744228), and guiding people when they add more languages as to where can they enable the language switcher block (http://drupal.org/node/1738374).

Finally even managed to improve accessibility a little in Drupal 7 by adding language tagging to the language switcher block: http://drupal.org/node/1164682

Almost committed

Support for browser language code mappings

Browsers and the internet at large not always understand language codes exactly as Drupal does, for various reasons. We have been hard at work on a patch to make it possible to map arbitrary external language codes to internal languages: http://drupal.org/node/365615

Language awareness to forms

We aim to introduce a new "form language" concept, so that elements in the form can be informed about the language the form pertains to. This should help with loading and saving values in the right language even if complex form widgets are involved: http://drupal.org/node/1498874

Big things still in the works

Configuration metadata

As a minimal requirement, to be able to pre-translate shipped configuration on localize.drupal.org, we need certain parts of configuration files to be marked as translatable. The configuration metadata system aimed at a higher goal earlier, but time is running out and we need at least a minimal approach implemented: http://drupal.org/node/1648930

Entity/field translation user interface

Throughout the sprint, plach and peximo have been hard at work in the D8MI - Entity translation UI sandbox to build a first working version of the entity translation form, which I got demoed close to the end of the sprint. There is no issue for this yet, check out http://drupal.org/sandbox/plach/1719670 for the code.

Language-variant sensitive node access

We have been hard at work at this one, but more help is needed to figure out how best to do language-variant based node access with the current stored realms and grants system: http://drupal.org/node/1658846

Make EntityFieldQuery support multilingual properties

With properties becoming multilingual, there is some new plumbing needed to support looking up data in this query builder: http://drupal.org/node/1691952

New translations:// stream wrapper for .po files

Now that we have translations centralized in one directory with the express purpose of making that portable, it makes lots of sense to use a stream wrapper for that to achieve total independence for files referenced, so you can have your translations directory configured differently on your staging and live servers: http://drupal.org/node/1658842

Generalized language configuration from content types to the entity level

For content types, you can preset new nodes of that type to be in a specific language with various nice dynamic values to configure. There is no such functionality yet for taxonomy terms (per vocabulary) and we want this to be reusable for others as well: http://drupal.org/node/1739928

What's next?

All of the big things we need to get done are in the works. We just need people to focus on them. We have a running board of focus issues at http://hojtsy.hu/d8mi/focus and meeting every other week on Wednesdays to discuss progress and tasks to do. Watch http://groups.drupal.org/drupal-initiatives for announcements.

The biggest outstanding pieces are the entity translation user interface, conversions of entity types to translatable properties (such as nodes, http://drupal.org/node/1498674), the configuration metadata issue as well as configuration contexts for retrieving the right version of the configuration needed (http://drupal.org/node/1763640). We also have missing pieces for the localization update integration, most notably comparing versions and downloading files (http://drupal.org/node/1742894).

Check out the Drupal 8's Multilingual Wonderland core conversation video for a deeper explanation of the missing pieces (and what we have done so far):

Click to watch "Drupal 8's Multilingual Wonderland"

We don't have any big sprints organized anymore for the year, however, we should keep looking at opportunities. A huge Drupal event coming up this year is BADCamp from November 1-4th that has space and scholarships for core initiative sprints. Whether it would be possible to do a D8MI sprint there is still to be seen. Also it is pretty close to the feature freeze date, so postponing anything in hopes that it will get done there is not workable.

We really need to switch into a mode where we focus on fixing issues with a bigger dedication outside of sprints as well. Nobody would like to see half-baked solutions persist in Drupal 8.

87 days to go before Drupal 8 feature freeze!