Multilingual goodness on the way for Drupal 7

nedjo's picture

A report back from the virtual code sprint on internationalization in Drupal core

What if the new Fields API in Drupal core could be used in multiple languages, so that any object type could be internationalized just by adding fields?

That's exactly what the "multilingual fields" patch currently being developed would make possible.

Multilingual fields is one of two major improvements to Drupal core's multilingual support to come out of the recent code sprint on internationalization.

Over the space of two weeks, Drupal developers from many countries came together for a "virtual" code sprint focused on enhancing multilingual support in Drupal core. The result is some great short term improvements and two patches that would vastly improve internationalization in Drupal.

Here is a report back on how we organized the sprint and what we got done.

Need for the sprint

Drupal 6 features major internationalization enhancements, thanks to efforts led largely by Gábor Hojtsy and Jose Reyero.

But these improvements were in many cases only first steps. There was a need for some focused collaboration to keep the momentum up and complete what had been started.

Getting organized

This was a "virtual" sprint in that, rather than all assembling in a single location, participants worked from their homes or offices in at least seven different countries. Not being together in one room presented some logistical and communications challenges, but it also freed up people to participate who would not have had the time or money to travel.

In preparation for the sprint, we:

  • Combed the issue queue for likely candidates, using the new issue tagging functionality to categorize these issues with an "i18n sprint" tag.
  • Created a page pulling together information on some key issues to tackle.
  • Posted a discussion here on to get ideas flowing on some of the key identified issues.
  • Created an event posting and emailed the full subscriber list of the Internationalization group to notify and invite them.
  • Individually contacted and invited Drupal contributors who had shown an interest in the area through e.g. posts to the issue queue.
  • Communicated with Drupal founder Dries Buytaert and Drupal 7 maintainer Angie Byron to let them know about the sprint and schedule in some time for reviewing patches.

Sprint participants and outcomes

Over a dozen developers from at least seven countries participated in the sprint.

During the sprint we posted a series of updates--see these for a detailed summary of what we did:

Francesco Placella, Jose Reyero, Daniel Kudwien, Stella Power, Nat Catchpole and Nedjo Rogers participated in the full sprint and several other developers joined in for parts.

We found it worked well to pick a couple of big issues and then also a few smaller ones. There were big problems that needed tackling, so major patches were in order. But it also helped to have some more bite sized pieces.

Some quick gains were:

The two big issues we tackled in the sprint centered on extending the types of data that can be translated in Drupal core.

First, Francesco Placella, Daniel Kudwien, Nat Catchmore and others worked on enabling the newly minted core Fields API to include multilingual support. One of the biggest new features of Drupal 7, "fields in core" as it's known will allow any data type (content, user, whatever) to be extended with custom fields, like the CCK module does for content in Drupal 5 and 6. The actively emerging translatable fields patch would allow all of those fields to be multilingual, effectively extending multilingual support to any fieldable data type.

Next, Jose Reyero, Nedjo Rogers, and others tackled the need to have translation of user-defined text strings - e.g., custom menu titles - handled in Drupal core alongside the existing support for code-defined strings. In the space of the sprint we wrote a new set of locale data handling methods for core, and segued into a robust set of methods that could be used wherever there's a need to read records.

Virtual code sprints: lessons and conclusions

Holding a virtual code sprint broadened participation and meant the sprint could be done on no budget beyond the costs of time donated by participants.

The two main issues tackled in the sprint - translatable fields and a locales API - are the sort of problems that call for intensive discussion and collaboration.

  • Have someone in a coordination role. It was useful to have at least one sprint participant focus on facilitating discussion and planning. If, like ours, the sprint is taking place across many time zones, it's probably best to divide this responsibility between people in different time zones to ensure that facilitation is available as needed throughout the sprint time.
  • Have a greeter. Another useful role was a greeter, to welcome potential sprint participants as they signed into the IRC chat and help them figure out where they could plug in. This help included things like answering questions about how to set up a development environment, apply patches, and post to issues.
  • Schedule time with major players in the relevant areas. In our case, Barry Jaspan and Yves Chedemois, two of the main fields in core authors, both found time to provide input and guidance on the multilingual fields issue and also set aside time to meet with us following the sprint and help analyze in detail what was needed to complete the patch.

As well as some great progress on the code front, an other major success of the virtual sprint was bringing in some significant new contributors. A highlight here would be Francesco Placella, who is playing a lead role in the work on translatable fields. Francesco is providing keen insights as well as the solid development work needed to address some particularly challenging code problems. Drupal needs more contributors like Francesco, and if this sprint has helped him find his place in Drupal development that in itself is a major gain for the community.

Definitely there were things we missed by not being together in the same place. Like going out for pizza and beer afterwards. But this experience confirmed the value and feasibility of holding virtual sprints. If anyone wants some guidance organizing a virtual sprint, please contact any of the organizers of this one and we'll be happy to help.

How to help

Missed the sprint? Participated and keen to do more?

Either way, there's lots left to do!

The translatable fields and locale API both need more review, testing, and work before they can be applied. And there are many other ways we can continue to push forward internationalization support in Drupal, both in core and in contrib. Please help keep the momentum going by posting with your ideas, testing results, and improvements.

And if you're at DrupalCon DC, participate in the Multilingual Drupal Status Report and Discussion session.