Separate interface and content language in Drupal 7

Drupal 6 features new methods for making your site multilingual. Content language can be defined by a path prefix (example.com/nl/about for a Dutch about page) or by a domain (example.nl/about for the same page). However, lots of people think this is not flexible enough. They want users to be able to use an interface language of their choice, independent of the content language. I'm one of those people, so I decided to take a shot. This patch allows site administrators to decide how the content language should be negotiated:

  • Not (Or by the user if allowed)
  • By path prefix
  • By domain

This should look familiar to those using Drupal 6. The difference is that Drupal doesn't automatically fall back to the site's default language if the path contains no prefix or the domain matches no language. If this happens, Drupal throws a 404. A newly added checkbox allows administrators to enable the good ol' fallback option, so no worries. A second checkbox (which is new too) allows for a completely new feature. If enabled, users may select a language of their choice in their user profile. This language will be used for the interface and e-mails and also for the content, but only if language negotiation is set to None. The following table illustrates how the content and interface languages are negotiated:

User's preference Language setting E-mails & interface Content
Site default None Site Default Site Default
Path prefix URL specific URL specific
Domain name URL specific URL specific
User defined None User defined User defined
Path prefix User defined URL specific
Domain name User defined URL specific

As you might have noticed this approach does not differentiate between anonymous and authenticated users. This opens a way for contributed modules that provide anonymous users with a way to select a language of their choice as well.

This is all good and well, but we're not there yet. The patch is still under development and I need a lot of feedback before this baby will get ready to be committed. If you have a few minutes and would really like to see this feature get in Drupal 7, take a look at the issue and try the patch!