Add basic pology posieve request support
ClosedPublic

Authored by sdepiets on Aug 31 2018, 9:27 AM.

Details

Summary

Configuration dialog

I've added an option to posieve.py previously to allow a launch on a single entry. This is just a start, the goal is to have a better integration of Lokalize as a retriever of pology information and not only as a client for pology.

Diff Detail

Repository
R456 Lokalize
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
sdepiets requested review of this revision.Aug 31 2018, 9:27 AM
sdepiets created this revision.
sdepiets updated this revision to Diff 40751.Aug 31 2018, 10:40 AM

Moved it in msgCtxt

sdepiets retitled this revision from Add basic pology posieve support to Add basic pology posieve request support.Aug 31 2018, 10:42 AM
sdepiets edited the summary of this revision. (Show Details)
sdepiets added a subscriber: Localization.
sdepiets updated this revision to Diff 40752.Aug 31 2018, 10:44 AM

Incomplete refactoring

aacid added inline comments.Aug 31 2018, 8:18 PM
src/msgctxtview.cpp
219

You should call delete/deleteLater on m_pologyProcess here

sdepiets updated this revision to Diff 40879.Sep 3 2018, 1:18 AM

Delete later

sdepiets updated this revision to Diff 40881.Sep 3 2018, 1:21 AM

Adding missing ui file

sdepiets updated this revision to Diff 40883.Sep 3 2018, 1:40 AM

Removed useless line

This revision was not accepted when it landed; it landed in state Needs Review.Sep 3 2018, 2:09 AM
This revision was automatically updated to reflect the committed changes.
huftis added a subscriber: huftis.EditedSep 6 2018, 5:16 PM

I have tested this, and it seems to work, but there’s one problem: It freezes the UI when calling Lokalize. It might be that the language I’m translating into (Norwegian Nynorsk) has very many or slow rules, but the UI is frozen for about two seconds whenever I move to a new entry with this feature enabled. Is it possible to call posieve in a separate thread (i.e. as a background process)?

Also, shouldn’t it by default just call ‘posieve -u %u check-rules %f’, without any need to set a custom command-line?

I have tested this, and it seems to work, but there’s one problem: It freezes the UI when calling Lokalize. It might be that the language I’m translating into (Norwegian Nynorsk) has very many or slow rules, but the UI is frozen for about two seconds whenever I move to a new entry with this feature enabled. Is it possible to call posieve in a separate thread (i.e. as a background process)?

Sorry I haven't got time to answer this, I plan to address it after the sonnet bug which is more critical ( https://bugs.kde.org/show_bug.cgi?id=398661 )

Also, shouldn’t it by default just call ‘posieve -u %u check-rules %f’, without any need to set a custom command-line?

I can put a default value, but it will depend how the user has installed pology

The KProcess is now fully asynchronous, i've tested with a "sleep 2 && pology..." command and it works. Added a couple limitations as well so that we don't have hundreds of parallel pology processes if the user goes through messages very quickly.

https://github.com/KDE/lokalize/commit/a4e10343edd93f7f925a0f5a250794dff46dfee6
https://github.com/KDE/lokalize/commit/d9565692118a9d6132eb3457cb4dd346c3ded77c