Translating Strings in Drupal Just Got Easier
It's Time to Say goodbye to the Bulky, Distraction Prone Translation UI
This past week I was doing some translation work for the United Nations' StandAgainstPoverty.org site and realized just how bloated the process was. I wasn't actually translating, just entering a few translations, finding missing t functions (the little piece of code you're supposed to put in any text you want translatable in modules you write in Drupal), and adding these t functions around strings. It's a daunting task - not the code part, but the actual process of translating a string on the Drupal user interface.
Take a look at what the translation string process looked like:-- go to the page where the string is and look at it carefully, noting the case of the letters* boring web 1.0 page reload-- go to the locale administration page and search for the text, remember the case sensitivity because the search is case-sensitive, click search.* boring web 1.0 page reload-- click on the matching string* boring web 1.0 page reload-- type in the translation of the string and submit it* boring web 1.0 page reload-- go back to the page with the strings you were translating and repeat. If you are not the translator yourself and are just doing data entry like I was, then you need to reference your translation document on top of all this. That's just a whole lot of juggling. And it just wasn't any fun.
Enter the l10n_client written by Gabor Hojtsy and touched with Young Hahn's magic wand, followed up by a just-in-time backport to Drupal 5 by multilingual expert Jose Reyero.
Watch this video to see just how easy it is.
This fix makes it a lot easier to translate strings, and it really saved my day by allowing me to get the translation work out of the way and get back to work on actually pushing the site live. It's also so easy to use that it let's our clients' teams do the rest of the translations themselves.
Here are the new show-notes compared to the list above. There's just one line : ) :-- Visit page where string appears, click, translate, submit, repeat. No page reloads, no distractions, empowered clients, and more time for launch. Drupal saves the day.
Immediately this sparked the question, what else can we do with this? Maybe some people will find it easiest to double-click a string directly on the page and have a lightbox/popup appear to translate the string. There are some ideas floating around, so the next step is to see what can work well to handle this. Then, what about translating nodes? It's not as bad a process as translating strings, but the workflow could definitely be improved. It would be nice to just click a flag next to a node title if you have the access permission, and have a lightbox/popup appear to let you translate the parts of the node which are not already covered by the t function/existing l10n_client approach. We should have some more developments soon.
A big thank you to Jason Wojciechowski at the UN Millennium Campaign (and long-time fellow Drupal hacker) for sponsoring the Drupal 5 backport and investing in this tool for your projects. It was a clear decision for Jason, knowing what string translation is like otherwise. Thank you Gabor, Young, and Jose for the code and ideas. This tool simply rocks!

6 Comments
You read my mind!
This is exactly what I needed to finish one project these days. The current translation process was so boring :)
Thanks to everybody involved on this module's creation.
reply
Hi!
I hesitate that string technic is so great, but I will try it on.
Compatibility with phptal theme engine
Hi,
Your string translation technique looks excellent!
Would your l10n_client be compatible with the phptal theme engine?
http://drupal.org/project/phptal
Dennis
hi Dennis, thanks for your
hi Dennis, thanks for your comment. It should be; the l10n_client adds itself to the page in the hook_footer and relies on jquery for hiding and lot of the user interaction.
cheers,
Ian
Wow, that is really slick!
Wow, that is really slick!
thanks Justin, Young has an
thanks Justin, Young has an update on the latest awesomeness he's working into the l10n_client over here.
Ian