As a Drupal site administrator whose native language isn't English you know the drill. You've built a site and everything looks splendid except for one tiny detail – the language of the site. You've installed the latest language pack from drupal.org but you find English strings here and there through your pages. But hunting them down and nailing them in your native idioma, langue or språk isn't all you need to do. You have to do it using the translation interface in Drupal which leaves a lot to be desired.
So you head over to the Translate Interface page, click Search, type in the right keywords and you're awarded with the matching strings. Click Edit and you'll see something like this:
Translating a string like this usually involves figuring out what the best translation is, type it and copy the parts of the original string you need.
Translatable strings in Drupal do not contain literal just text but placeholders as well. Those are the words with @, ! and % in front of them. They're replaced by the corresponding variables when the string is displayed to the user. Placeholders have to be kept intact in the translated string, a task that requires manually copying them. A boring, error-prone and slow task. It can also be difficult to see mistakes and the only way to discover them is to view the translated string in context.
Introducing Xlationist
Pronounced "translationist", this module adds a few lines of CSS and JavaScript to do its magic and here's the result:
Inserting placeholders into the translation textarea is a matter of putting the caret where you need it and clicking the placeholder. If you want to start translating using the entire original text, just click the big green button. Easy as pie.
The result is fewer typing errors, less copy-and-paste and the ability to focus more on translating and writing.
The current version of the module is considered alpha. I wrote it in less than three hours in an attempt to put some of my ideas in code. As a result, the module hasn't been tested with every browser or with many languages. I know of at least one character encoding bug that needs to be fixed. The code can be improved upon and patches are more than welcome, as always.
Also, if you translate Drupal using Translate Interface, be sure to contribute your translations using the excellent localization server by Gábor Hojtsy. By contributing them you help make Drupal accessible to more people and make it possible for modules to come bundled with translations direct off the localization server. It's a feature that isn't there yet but hopefully soon!
I have more ideas for Xlationist and how it can be improved as well as for other parts of Drupal's administration pages in need of usability goodness. My ultimate goal is to deprecate the module by getting this into core as it's where it should be. I hope to be able to submit a patch for Drupal 8 as soon as Xlationist has learnt to walk and bugs have been ironed out.
http://drupal.org/project/xlationist
NB: Admittedly the word "translationist" doesn't exist in the dictionary. I just thought it would be cool to have a module with a name starting with an X. More importantly though, the name should not limit the purpose, and Xlationist may likely be extended in the future why the name Xlationist fits the bill.
