Enabling suggestions while translating
Pootle has the ability of making translation suggestions but at the moment they’re invisible at the time of translating unless the user selects View Suggestions from the editing functions, which is not a really effective approach.
Therefore, aiming to avoid duplicated work that can cause not seeing what others have suggested before, I’m working on enabling suggestions while translating. The user now sees the suggestions just below the translation text area. Users with reviewing privileges are able to accept and discard suggestions from the same interface, and that’s actually the part where I’ve been thinking of something different. Here comes the AJAX part.
To keep things easy and not reinventing the wheel, I’ve used jQuery, just as the guys working at mozootle have done ;) jQuery is a JavaScript library focused on keeping simplicity for developers at the same time of being fast and powerful. For instance, creating an HTTP POST request using the famous XMLHttpRequest object is as easy as writing $.post("myscriptname", {param1: "value1"});
Coming back to our context, if the user has reviewing privileges, the interface will show two additional buttons (images) to accept or reject the suggestion. I’ve used the tangoished GTK+ stock icons (resizing them from 20×20 to 16×16), although I could use famfamfam silk icons too; both are great.
When the user selects an option, jQuery starts its action: first, retrieves the necessary parameters and creates a serialized string, then it makes an AJAX request and finally if all goes fine the suggestion is added or removed.
To give this a cool aspect, I’ve used an effect similar to the WordPress Comments Management. As of today, this is implemented only for the reject option, because accepting a suggestion should suppose more things than simply accepting that one: it should reject all the remaining suggestions and display things accordingly.
I think this feature will be more or less finished by this week, so keep an eye on bug 427 for patches.
Update: I’ve made a little screencast to show you how this works.

June 30th, 2008 at 18:09
[...] project. He has already completed implementing the first feature in the project roadmap, and his ideas on feature #2 looks [...]
July 1st, 2008 at 22:55
I replied in more detail on the mailing list, but I just wanted to say: a picture paints a thousand words! It makes it much easier to evaluate the idea than it would be with code, and makes it easier for anybody to see what you have in mind. Well done!
We might want to check some of the work happenning on the mozootle branch - I see they are also using jquery for something, so there is perhaps a point where coordination might be useful. As far as I know they are also on the Pootle mailing list, so feel free to discuss anything there.