It would be nice for html-tools to provide an add-on to the translation interface that allows for document translation and for APY to provide document translation support.
(10:23:01 PM) firespeaker: Жүктөп алуу Айтатын саған сырым бұл.txt
(10:23:15 PM) firespeaker: Жүктөп алуу means "download"
(10:23:21 PM) firespeaker: but it should come after the file
(10:23:24 PM) sushain: UGH
(10:23:25 PM) firespeaker: not before the filename
(10:23:25 PM) sushain: :(
(10:23:38 PM) sushain: right when you pasted that
(10:23:46 PM) sushain: my mind: "the download is in the wrong place isn't it..."
(10:23:51 PM) firespeaker: :-P
(10:24:07 PM) sushain: meh, it can be fixed
(10:24:26 PM) sushain: using {{fileName}} or something
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
We probably shouldn't do threading since it makes python eat all our swap :-) It should be simple enough to start the process using tornado.process.Subprocess in a @gen.coroutine using "yield", similar to translateSimple()
We might want to have some locks or a similar method of ensuring we don't start more than N processes at a time (not likely to happen in normal usage, more to protect against malicious users), could have a dict of doc_locks just like pipeline_locks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
(7:31:05 PM) begiak: apertium: sushain97 * 56080: /trunk/apertium-tools/apertium-html-tools/: index.html.in, assets/js/translator.js, doctranslate.patch (-): Functional document translation -- still needs aesthetic improvements and localization
(7:31:14 PM) begiak: apertium: sushain97 * 56081: /trunk/apertium-tools/apertium-apy/: translation.py, servlet.py: Functional document translation -- still needs threading and logging
(2:32:06 PM) begiak: apertium: sushain97 * 56098: /trunk/apertium-tools/apertium-html-tools/: assets/strings/spa.json, assets/strings/eng.json and 3 other files: Localization/functionality/aesthetic improvements for document translation
(3:04:38 PM) begiak: apertium: sushain97 * 56099: /trunk/apertium-tools/apertium-apy/: translation.py, servlet.py: Use file command to detect MIME type
(3:04:43 PM) begiak: apertium: sushain97 * 56100: /trunk/apertium-tools/apertium-apy/servlet.py: Add download headers to /translateDoc
(3:07:08 PM) begiak: apertium: sushain97 * 56101: /trunk/apertium-tools/apertium-html-tools/assets/js/translator.js: Stop sending MIME type with /translateDoc request
Still needs threading/logging on APY and force file download on client-side (if possible).
(10:23:01 PM) firespeaker: Жүктөп алуу Айтатын саған сырым бұл.txt
(10:23:15 PM) firespeaker: Жүктөп алуу means "download"
(10:23:21 PM) firespeaker: but it should come after the file
(10:23:24 PM) sushain: UGH
(10:23:25 PM) firespeaker: not before the filename
(10:23:25 PM) sushain: :(
(10:23:38 PM) sushain: right when you pasted that
(10:23:46 PM) sushain: my mind: "the download is in the wrong place isn't it..."
(10:23:51 PM) firespeaker: :-P
(10:24:07 PM) sushain: meh, it can be fixed
(10:24:26 PM) sushain: using {{fileName}} or something
Remaining issues:
File drag and dropLast edit: Sushain Cherivirala 2014-12-02
We probably shouldn't do threading since it makes python eat all our swap :-) It should be simple enough to start the process using tornado.process.Subprocess in a @gen.coroutine using "yield", similar to translateSimple()
We might want to have some locks or a similar method of ensuring we don't start more than N processes at a time (not likely to happen in normal usage, more to protect against malicious users), could have a dict of doc_locks just like pipeline_locks.
Does this still sound like something to do? Seems relatively simple with a mutex.
Do you think that DOC/XLS/PPT support and logging would be nice? If so, I'll migrate this to ticket(s) on GitHub and create GCI tasks.
+1 on migration to github. From my reading of the code, we still have no max-n-process-cap; and translation.translateDoc isn't a @gen.coroutine yet.
Migrated to Github:
https://github.com/goavki/apertium-apy/issues/39
https://github.com/goavki/apertium-apy/issues/41
https://github.com/goavki/apertium-apy/issues/40