Closed (fixed)
Project:
TMGMT Translator Gengo
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
4 Dec 2012 at 12:30 UTC
Updated:
17 Jan 2013 at 14:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
berdirWhat TMGMT core does is just a rough estimate of the words, this has no effect on the costs. This is calculated before it's even known that MyGengo might be used and it's used for certain internal checks.
The only thing that would be possible is updating after a job has been submitted/sent for an offer.
The wordcount that is displayed in the offer before you submit a job is the only thing that is relevant for the costs.
Comment #2
bforchhammer commentedThe gengo api support quotes: http://developers.gengo.com/v2/service/#quote-post
A quote returns the number of words ("unit_count") and the respective cost ("credits").
Can we use that to display the correct number of words and cost before submitting a job?
Edit: and slightly off-topic, but it would be cool if we could also display the current gengo account balance from http://developers.gengo.com/v2/account/#balance-get
Comment #3
bforchhammer commentedAttached patch adds functionality to query the quote service mentioned above... it also changes a few other things which may or may not need to go into separate issues. ;-)
Notice the different word counts; the top one (353) is the one calculated by tmgmt, the bottom one in Checkout Settings (265) is the one from Gengo. Cost and ETA are also returned from the service, so I also showed them in the UI...
Comment #4
blueminds commented@ihamilton thanks a lot for your patch. I reviewed your patch with following changes:
- quote logic now fully relies on gengo service including the word count
- getGengoLanguagePairs() method is now the only place to query the language_pairs resource
- quality options are build in the ui controller based on language pairs returned from gengo
Changes are pushed into repository. Please see if it works for you as well, if so we can go to RTBC.
Comment #5
miro_dietikerSince you committed it, i switch to fixed. Please reopen if you feel it is not 100% done yet.
Comment #6
bforchhammer commented@blueminds: Thanks for committing. Please mention me in the commit message next time you commit one of my patches... :-)
Also, there's a few things that still need work IMO:
tmgmt_mygengo_ajax_callback_translator_select()needs to cleaned up ("jo vole"?)Comment #7
bforchhammer commentedForgot to mention: I tested it with the sandbox and apart from the issues above things seem to be working well! Quoting works, functionality-wise things seem good :)
Comment #8
blueminds commentedsorry... I mentioned ihamilton's name instead - will update commit message and push it as soon as this patch is okay with you.
Here are answers to your points:
- Machine translation was not present as it is not supported for requested language pair. I added it back, I guess as it was misleading for you it will be for others as well. So now instead it will display error message about not supported language.
- Watchdog message removed, also removed the ajax callback, and using the default one - leftover from debugging
- Notice fixed
- one-liner has changed as it needs to deal with several things. First - settings will not get updated on repetitive change of quality select box. Second - we need to set default if there is nothing in. I guess it is more readable when split into two blocks where each is explained in comment.
- Description changed to your wish.
Please see the patch.
Comment #9
blueminds commentedComment #10
miro_dietikerSorry to tell you: You cannot update commit messages on d.o. :-) Only pushing new commits fast forward is possible.
Comment #11
bforchhammer commentedI actually think it's okay to completely hide invalid choices... But I thought that machine translation was always available, regardless of the current language pair. It seems that you just cannot get a quote for a machine translation (which makes sense, because cost and eta are always zero).
With patch #8 it's currently not possible to get a machine translation from English to German, which I'm quite sure was possible before! (Instead I get
#1551 language service not supported)Comment #12
blueminds commentedRegarding invalid choices - it seems that machine is always available, at least I could not find a way to tell from the gengo api. So currently it seems that the only invalid choice is ultra as gengo does not support grouped jobs for this tier - so before final push we should comment out this option and wait for gengo to fix this.
The patch is a mess as it includes code from other issue as well :( ... the subject of this issue starts on line 96.
Comment #13
miro_dietikerCan you then provide a better patch that is not messy? I don't really what i should review in your messy patch...
Please don't cover adding other translation modes in this issue. It has a clear scope defined by title. Add new ons for the other topics. I'm missing the thread here.
Comment #14
blueminds commentedSo to move forward I pushed the latest code. All seems to work nicely - the subject of this thread as well the tier select.
In case there are further issues I suggest to open new thread and solve it there.
... sorry for disorganising the workflow here :|
Comment #15
miro_dietikerGreat, thank you. We should possibly also trigger Gengo to test it and then release a new beta?
Comment #16
bforchhammer commentedFollow-up: #1877912: Notice: Undefined index: ultra in checkoutSettingsForm()