Localizing your Drupal site just got a whole lot easier

Whenever you spot an untranslated string on your Drupal site, you need to:

  1. Remember the string or at least some unique identifier from the text.
  2. In Drupal 6 go to Administration - Site building - Translate interface - Search tab; in Drupal 5 go to Administration - Site configuration - Localization - Manage strings tab.
  3. Enter what you remembered in step 1 and hit submit.
  4. Identify the string in the result list or if it is not found, go back to step 1 and find an actually unique part of the string to search for.
  5. Hit Edit on the item in the result list if found.
  6. A form with all languages are displayed, fill in the translations you want to provide.
  7. Go back and check whether the translation was used properly.

This is quite time consuming and error prone. Of course a lot of people suggested that we should have a solution which gets closer to the user, but it was not implemented before. So here I am to tell you that there is a solution for you which just works and eliminates nearly all of the steps above.

Let me introduce Localization client module. This is a Drupal 6 only module for now (but read on), because it utilizes new features in how Drupal 6 supports interface translation. What it does is actually very simple: collects all strings used on any given page for you and presents it in a nice widget which allows you to translate anything displayed on the page to the language the page should have been displayed with.

This is not a breaking new module, actually the backend was done as part of my Google Summer of Code 2007 involvement. Although, it did have a very clunky interface which was not too friendly on the user. That was when Development Seed sponsored Young Hahn to step in, and actually implement an enjoyable interface for this functionality. I am sure you will love how it behaves and makes your life easier.

Once you have l10n_client module enabled, you have access permission to use it and you are on a page which is not displayed with the built-in English language, a little bar is shown on the bottom of the page which pops up when clicked and displays the editing widget. The standard Drupal locale module database is used as a backend, so whatever you enter is saved right away to the database.

Due to how this ties into Drupal core, and how the core t() function needs to be modified (patch), this module is not possible to backport to Drupal 5 without core patching. Nonetheless people at Development Seed put resources into backporting it to Drupal 5, so your hope is not lost, if you are not into Drupal 6 functionality yet.



greggles's picture


Perhaps the interface is too easy and too useful to be possible in Drupal ;)

That is great work, Gábor - I know this will make the lives of our translators much easier. Thanks to you and the other folks involved in this.

yched's picture

JS Pop-up ?

The UI could come in a JS popup ?

Not that we have js popups in drupal core right now, but I long for that day (confirm forms, batch progressbars...). And with with Panels 2 (and maybe Views 2 ?) using their own popups, they could become 'drupalish' in the next few months...

Anyway, this looks terrific !

elv's picture

I mean, your interface looks

I mean, your interface looks great! But as any module developer can create his own, sometimes the whle user interface is not very consistent when your site uses a lot of contrib modules.

Ideally modules would share common styles and markup, but I've talked about this with some Drupal ninjas and it seems it's a complex problem. And I guess Javascript widgets need a separate stylesheet, so that a theme won't override it by default.

pp's picture


Amikor beszéltél erről már akkor is ígéretesnek tűnt, de a videót látva le vagyok nyűgözve! Ez űbertuti! Le a kalappal!

When We talked about this it seemed to be promising, but after seeing the video I'm spellbound!


Ian Ward's picture

Up and running on 5.x

Hey all, the backport is now here in CVS and we've got it running for a UN project which is discussed over here on our blog. You just need to apply a simple patch to the locale module. It's working pretty well as you can see in the short little video. Gabor - thanks for your awesome vision in making translators' and site administrators' lives easier through the implementation of tools like these. It's simply awesome!

Alex's picture

I'm missing the way how i

I'm missing the way how i could get the newly translated strings back to d.o in CVS. I thought "Localization client" have a sync logic inside... it won't help much if i have this translated and after the next upgrade all is lost and no one else can benefit from this translation.

Add new comment