I have implemented what I call "translation in context" in this application:
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
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
you cannot make a Ctrl+Click. But for translation purposes it can be opened
in a desktop browser. Anyway, it serves to illustrate/demonstrate the idea
of "translation in context" (or whatever it can be called).
The implementation details are not so complicated. This app uses a
that is used to mark the strings that need to be translated, like this:
it returns the corresponding "translation", which is then used in the
I have overridden the function `_()` so that it does not return just the
"translation", but it returns instead a decorated translation like this:
<span class="gettext" sguid="id-of-the-string">translation</span>
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 in a tab the proper URL for translating that
in the translation server.
My question is:
Is it possible to implement something like this for LibreOffice?
I think that it would be a great feature for improving the quality
of translations and for helping users to give feedback and suggestions
to the translators.
I believe that it should be possible, but I don't know the details of the
translation system in LibreOffice. 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. It can be designed to work with B-Translator, or Pootle, or
some other online translation system. But maybe it can also work with
local desktop applications like Virtaal, Lokalize, etc.
It seems to me like an interesting and important project, which may also
turn out to be not so difficult to implement.
To unsubscribe e-mail to: firstname.lastname@example.org
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/l10n/
All messages sent to this list will be publicly archived and cannot be deleted
- [libreoffice-l10n] Implementing "translation in context" · Dashamir Hoxha
Impressum (Legal Info)
: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (MPLv2
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our trademark policy