Use Alternative UI Languages on Your Drupal Site

Drupal Planet:

I run some German-language sites, but I strongly prefer working with an English-language user interface. A possible solution is the Administration Language module, which lets you select an alternative langauge for the administration pages, but it falls short in several ways:

  • I want to see everything in English, not just the administration pages,
  • I have a deputy administrator who prefers to see the administrtion pages in German, and
  • occasionally I do like to see the German interface, so that I can see what others are seeing, when they come and tell wild stories.

My preferred solution requires nothing but the Locale core module and it works equally well for Drupal 6 and Drupal 7: I create an en language subdomain. If I have example.com with a German interface, then I add en.example.com that displays the familiar English interface.

How to Set It Up

  1. Enable the Local core module.
  2. Go to admin/settings/language (for D6) or admin/config/regional/language (for D7) and select German (or whatever) as your site's default language.
  3. Go to the Configure tab and enable Domain Name / URL as your site's language selection mechanism. For D7 you need to go one level deeper and select Domain.
  4. Come back to the language list and edit the German language: Clear both its "Path prefix language code" and its "Language domain". This ensures that example.com and www.example.com both display the German interface, and also that all internal links point example.com.
  5. Finally, edit the English language and set its "Language domain" to the equivalent of "http://en.example.com".

Warning

Drupal lets you change the default language without adjusting the language domain, which causes problems: if you've set up your site as explained above and you change the default language to English, then all your internal links will immediately start pointing to en.example.com.

Nice Side Benefit: Two Sites

With this set-up, you now have two sites, example.com and en.example.com, and your browser allows you to have separate concurrent sessions with both of them. You can be logged into en.example.com as administrator and into example.com as a normal user, and when you make any configuration changes as administrator then you can immediately see the result as normal user.

Comments

Nice try, but only works if you have only on language enabled before adding the Admin UI language.

What if you have multiple languages?

If you add an Admin UI language, it will appear in Language switcher block and in node forms if you have multilingual content types.
This might be confusing for visitors or contributors.

Yes, I agree, this works best with a single-language site.

On a multi-language site, IF your preferred Admin UI language is not one of those languages, you'd have to do some custom programming to hide your Admin UI language.