In the vocabulary mobile app (http://v.btranslator.org) I have implemented what I call translation in context. It works like this: when the user makes a Ctrl+Click on a string/translation anywhere on the UI, a browser tab/window is opened automatically with the correct url in the translation server (web application), where he can give a translation or a new suggestion for the selected string. Of course, for a normal Click the UI works as normally it should.
The funny thing is that this is a mobile application and in a mobile application you cannot make a Ctrl+Click. But for translation purposes it can be opened in a desktop browser. Anyway, at least it illustrates/demonstrates the idea of "translation in context" (or whatever it can be called).
_() that is used to mark the strings that need to be translated, like this:
_("string"). It returns the corresponding
translation, which is then used in the application.
I have overridden the function
_() so that it does not return just the plain
translation, but it returns instead a decorated translation like this:
Then I assign with jQuery an event-handler for the event Ctrl+Click to all the elements of the class "gettext". This event handler gets the id of the string and opens a tab with the proper URL for translating that string in the translation server.
What about the desktop applications (KDE, GNOME, etc.)? Is it possible to do something similar? I am not sure, maybe it is, maybe it is not possible. The most difficult part in my opinion is how to mark (or decorate) the translated string, so that it can respond to a Ctrl+Click event. Then you can construct the correct url and open it in browser.