<div dir="ltr"><span style="color:rgb(0,0,0);font-size:12.8000001907349px">Hi,</span><div style="color:rgb(0,0,0);font-size:12.8000001907349px"><br></div><div style="color:rgb(0,0,0);font-size:12.8000001907349px">I have implemented what I call "translation in context" in this application:</div><div style="color:rgb(0,0,0);font-size:12.8000001907349px"> - <a href="http://v.btranslator.org/" target="_blank">http://v.btranslator.org/</a></div><div style="color:rgb(0,0,0);font-size:12.8000001907349px"> - <a href="http://v.btranslator.org/?proj=ICT_de&lng=de" target="_blank">http://v.btranslator.org?proj=ICT_de&lng=de</a></div><div style="color:rgb(0,0,0);font-size:12.8000001907349px"> - <a href="http://v.btranslator.org/?proj=ICT_fr&lng=fr" target="_blank">http://v.btranslator.org?proj=ICT_fr&lng=fr</a><br></div><div style="color:rgb(0,0,0);font-size:12.8000001907349px"> - <a href="http://v.btranslator.org/?proj=ICT_it&lng=it" target="_blank">http://v.btranslator.org?proj=ICT_it&lng=it</a></div><div style="color:rgb(0,0,0);font-size:12.8000001907349px"><br></div><div style="color:rgb(0,0,0);font-size:12.8000001907349px"><div>It works like this: when the user makes a Ctrl+Click on a string/translation</div><div>anywhere on the UI, a browser tab/window is opened automatically</div><div>with the correct url in the translation server (web application), where he can</div><div>give a translation or a new suggestion for the selected string.</div><div>Of course, for a normal Click  the UI works as normally it should.</div></div><div style="color:rgb(0,0,0);font-size:12.8000001907349px"><br></div><div style="color:rgb(0,0,0);font-size:12.8000001907349px">The funny thing is that this is a mobile application and in a mobile application</div><div style="color:rgb(0,0,0);font-size:12.8000001907349px">you cannot make a Ctrl+Click. But for translation purposes it can be opened</div><div style="color:rgb(0,0,0);font-size:12.8000001907349px">in a desktop browser. Anyway, it serves to illustrate/demonstrate the idea</div><div style="color:rgb(0,0,0);font-size:12.8000001907349px">of "translation in context" (or whatever it can be called).</div><div style="color:rgb(0,0,0);font-size:12.8000001907349px"><br></div><div style="color:rgb(0,0,0);font-size:12.8000001907349px">The implementation details are not so complicated. This app uses a</div><div style="color:rgb(0,0,0);font-size:12.8000001907349px">gettext-like localization system, where there is a JavaScript function `_()`</div><div style="color:rgb(0,0,0);font-size:12.8000001907349px">that is used to mark the strings that need to be translated, like this: _("string")</div><div style="color:rgb(0,0,0);font-size:12.8000001907349px">It returns the corresponding "translation", which is then used in the application.</div><div style="color:rgb(0,0,0);font-size:12.8000001907349px"><br></div><div style="color:rgb(0,0,0);font-size:12.8000001907349px">I have overridden the function `_()` so that it does not return just the plain</div><div style="color:rgb(0,0,0);font-size:12.8000001907349px">"translation", but it returns instead a decorated translation like this:</div><div style="color:rgb(0,0,0);font-size:12.8000001907349px"><br></div><div style="color:rgb(0,0,0);font-size:12.8000001907349px">    <span class="gettext" sguid="id-of-the-string">translation</span></div><div style="color:rgb(0,0,0);font-size:12.8000001907349px"><br></div><div style="color:rgb(0,0,0);font-size:12.8000001907349px">See: <a href="https://github.com/FreeSoft-AL/vocabulary/blob/gh-pages/js/_app/translate_in_context.js#L43-L54" target="_blank">https://github.com/FreeSoft-AL/vocabulary/blob/gh-pages/js/_app/translate_in_context.js#L43-L54</a></div><div style="color:rgb(0,0,0);font-size:12.8000001907349px"><br></div><div style="color:rgb(0,0,0);font-size:12.8000001907349px">Then I assign with jQuery an event-handler for the event Ctrl+Click</div><div style="color:rgb(0,0,0);font-size:12.8000001907349px">to all the elements of the class "gettext". This event handler gets the</div><div style="color:rgb(0,0,0);font-size:12.8000001907349px">id of the string and opens a tab with the proper URL for translating that string</div><div style="color:rgb(0,0,0);font-size:12.8000001907349px">in the translation server.</div><div style="color:rgb(0,0,0);font-size:12.8000001907349px">See: <a href="https://github.com/FreeSoft-AL/vocabulary/blob/gh-pages/js/_app/translate_in_context.js#L82-L98" target="_blank">https://github.com/FreeSoft-AL/vocabulary/blob/gh-pages/js/_app/translate_in_context.js#L82-L98</a></div><div style="color:rgb(0,0,0);font-size:12.8000001907349px"><br></div><div style="color:rgb(0,0,0);font-size:12.8000001907349px">My question is:</div><div style="color:rgb(0,0,0);font-size:12.8000001907349px">Is it possible to implement something like this for KDE (Qt) applications?</div><div style="color:rgb(0,0,0);font-size:12.8000001907349px">I think it would be a great feature for improving the quality <span style="font-size:12.8000001907349px">of translations</span></div><div style="color:rgb(0,0,0);font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">and for helping users to give feedback and suggestions </span><span style="font-size:12.8000001907349px">to the translators.</span></div><div style="color:rgb(0,0,0);font-size:12.8000001907349px"><br></div><div style="color:rgb(0,0,0);font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">The most difficult part in my opinion </span><span style="font-size:12.8000001907349px">is how to mark (or decorate)</span></div><div style="color:rgb(0,0,0);font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">the translated string, so that it can respond </span><span style="font-size:12.8000001907349px">to a Ctrl+Click event.</span></div><div style="color:rgb(0,0,0);font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">Then you can construct the correct url and open it </span><span style="font-size:12.8000001907349px">in browser.</span></div><div style="color:rgb(0,0,0);font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">It can be designed to work with B-Translator, or Pootle, or </span><span style="font-size:12.8000001907349px">some other</span></div><div style="color:rgb(0,0,0);font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">online translation system. But maybe it can also work with </span><span style="font-size:12.8000001907349px">local desktop</span></div><div style="color:rgb(0,0,0);font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">applications like Virtaal, Lokalize, etc.</span></div><div style="color:rgb(0,0,0);font-size:12.8000001907349px"><br></div><div style="color:rgb(0,0,0);font-size:12.8000001907349px">Does anybody has detailed/deep knowledge about Qt and about the translation</div><div style="color:rgb(0,0,0);font-size:12.8000001907349px">system in KDE, so that he can give any hints about how to solve this problem?</div><div style="color:rgb(0,0,0);font-size:12.8000001907349px"><br></div><div style="color:rgb(0,0,0);font-size:12.8000001907349px">Thanks,</div><div style="color:rgb(0,0,0);font-size:12.8000001907349px">Dashamir</div></div>