This bug has 3 parts:
1) After submitting a live job to MyGengo, I check the 'review' tab for the finished translation. The translation is in English, or it's the same as the source language. Screenshot attached.
2) When I click Accept the English from above (which should be Japanese) is saved erroneously into that translation for that node, meaning I now have two English versions. (This sounds like it might be related to the core tmgmt module than mygengo?)
3) After clicking Accept the MyGengo website shows the job as still needing review. Mygengo module not updating the mygengo site correctly?
Comment | File | Size | Author |
---|---|---|---|
#21 | mygengo-auto-approve-add-translated.patch | 1.79 KB | Berdir |
#17 | tmgmt_mygengo.plugin.inc_.patch | 1.27 KB | devlada |
Screen Shot 2012-06-07 at 4.41.38 PM.png | 60.61 KB | Gastonia |
Comments
Comment #1
ethanethan CreditAttribution: ethanethan commentedThe translation data you get from mygengo is in English? Maybe that's what they return if the translation failed, or is pending.
Comment #2
Gastonia CreditAttribution: Gastonia commentedSorry, that could have been more clear.
The translation is correctly done and awaiting approval in mygengo. However, what is returned to Drupal (via the API?), or at least entered into the fields as a translation, is English, or the source langauge. So, for whatever reason, Drupal and MyGengo are not communicating correctly.
I am not sure what you mean by 'is pending.' Is that not the whole point of the interface is to see the translation and then approve it?, and then accept all the fields as a set of jobs in order to move forward with posting it?
Comment #3
BerdirAre you using the live or the sandbox environment of MyGengo?
Comment #4
Gastonia CreditAttribution: Gastonia commentedLive
Comment #5
BerdirIt's possible that there is a API difference, can you check if you can reproduce the same behavior in the sandbox?
Comment #6
devlada CreditAttribution: devlada commentedComment #7
devlada CreditAttribution: devlada commentedComment #8
devlada CreditAttribution: devlada commentedComment #9
BerdirI believe this is the issue:
You can see that it has a special case for production/sandbox but it doesn't actually use $translation then, it always uses $data->body_src. Can you check what exactly is returned in these two arguments and which one we need to use for which environment?
Comment #10
BerdirMoving this issue over to the new Mygengo Project.
Comment #11
devlada CreditAttribution: devlada commentedhmm, this can be prob, mygengo never return body_tgt both on live and sandbox. There are no other variable that contains the translation, this is an live response that I grabbed with watchdog:
stdClass Object ( [job_id] => 901177 [body_src] => Biology [lc_src] => en [lc_tgt] => de [unit_count] => 1 [tier] => standard [credits] => 0.05 [currency] => USD [status] => reviewable [eta] => -1 [ctime] => 1340631222 [callback_url] => http://tmgmt.dev.office.md-systems.ch/tmgmt_mygengo_callback [auto_approve] => 0 [custom_data] => 119][128][node_title [preview_url] => http://api.mygengo.com/v1/translate/job/901177/preview [captcha_url] => http://mygengo.com/express/captcha/?key=a8f43277bf95d82ff2300ee76e6ffe748ca048f0bb186d95896a49bda49b8083 )
Comment #12
BerdirI think the reason for that is "[status] => reviewable". My guess is that this means that you can now review the job on mygengo.com and the translation will only actually be sent to you when you reviewed.
Both TMGMT and mygengo.com can AFAIK be configured to auto-accept any translations, so in a real example, you would want to configure either one to auto-accept and not review it twice.
Comment #13
devlada CreditAttribution: devlada commentedComment #14
devlada CreditAttribution: devlada commentedTested again and I get translated text only in case when approve translation on mygengo live, this is response:
stdClass Object ( [job_id] => 902231 [body_src] => Literature [lc_src] => en [lc_tgt] => de [unit_count] => 1 [tier] => standard [credits] => 0.05 [currency] => USD [status] => approved [eta] => -1 [ctime] => 1340708661 [callback_url] => http://tmgmt.dev.office.md-systems.ch/tmgmt_mygengo_callback [auto_approve] => 1 [custom_data] => 127][136][body][0][value [body_tgt] => Literatur )
When auto approve is checked, I got the same response after manually approved translation, because we always send auto_approve => 0, this option works on our side (automaticaly create node), but not on mygengo.
When auto_approve is set to 1, mygengo directly return response and only in that case we should create translated node. Before that we do not have [body_tgt] and we can not display it on review page.
Comment #15
BerdirSounds ok to me. If status != approved, ignore. In regards to body_tgt, is live/sandbox the same now? Or are they different. If equal, remove that special case code, otherwise fix it.
Once this is fixed, we should open two follow-up issues:
- Consider adding job item messages when there is a status change on the mygengo side so that you know that you need to look there. However, this could easily lead to tons of messages for large jobs.
- Allow to control the auto_approve setting per translator/job (not sure if both, maybe only translator level?)
Comment #16
devlada CreditAttribution: devlada commentedYes, sandbox behaves the same, returns body_tgt only when status is approved. Patch follows...
Comment #17
devlada CreditAttribution: devlada commentedComment #19
devlada CreditAttribution: devlada commenteddependency problem...
What to do with review page?
Comment #20
devlada CreditAttribution: devlada commentedComment #21
BerdirAdd a mygengo-specific setting to auto-approve jobs in mygengo, this is the only way to get them through the sandbox (you can't approve, you can only auto-approve.
The attached patch works, but is missing a UI to change that variable, will open that as a follow up. This is currently the main blocker to have something that works.
Comment #22
BerdirCommited.