"TMGMT OHT" module is a plugin for Translation Management Tool module. It uses OneHourTranslation service for automated translation of the content.
Project page: http://drupal.org/sandbox/OneHourTranslation/1612398.
Git clone: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/OneHourTranslation/1612398.git tmgmt_oht.
Drupal version: Drupal 7
Dependencies: Translation Management Tool
I have examined my project using PAReview. Here is results: http://ventral.org/pareview/httpgitdrupalorgsandboxonehourtranslation161...
Reviews of other projects:
http://drupal.org/node/1619120#comment-6085064
http://drupal.org/node/1619120#comment-6085596
http://drupal.org/node/1632990#comment-6116076
http://drupal.org/node/1632990#comment-6116128
http://drupal.org/node/1635612#comment-6120558
http://drupal.org/node/1632990#comment-6116128
Comments
Comment #1
patrickd commentedwelcome,
Good to see that you've fixed all issues of the automated report
Please read about the workflow for project applications.
As installation and usage instructions are quite important for us to review, please take a moment to make your project page follow the tips for a great project page. Also make sure your README.txt follows the guidelines for in-project documentation. Your readme may follow the contents of your project page.
We do really need more hands in the application queue and highly recommend to get a review bonus so we can come back to your application sooner.
regards
Comment #1.0
patrickd commentedadded link to PAReview results.
Comment #2
DavidS commentedchanged description of the project
Comment #2.0
DavidS commentedadded more info regarding reviews
Comment #3
DavidS commentedI have added links to bonus reviews in the topic
Comment #4
DavidS commentedchanging status to needs review
Comment #5
patrickd commentedyou forgot the tag
Comment #5.0
patrickd commentedadded info about reviews
Comment #6
carlhinton commentedChecked through ventral - the code is clear of any errors
Comment #7
DavidS commentedyes, this has been mentioned in the first post.
Comment #8
berdirNice work! The code looks great.
A bunch of things that I noticed below, mostly just some ideas/remarks, the only things that should be fixed is the finished() call and the check_plain(). Happy to RTBC this after that.
The check_plain() here doesn't make much sense. That should only be used for things that are going to be displayed. You should be able to simply remove it.
Hint: You *could* use %status instead of adding "", that would wrap it in < em > tags by default. Also
in the submitted message.
You shouldn't use exit() in a page callback, that can have weird results because some cleanup things might not be run properly. If you don't return anything in your page callback then Drupal will render an empty page by default. If you really want to exit, you should call drupal_exit().
- I noticed that you have a hardcoded supported language list. This is fine but the downside is that when you add a new language on your side, you need to do a new release so that users can translate into that language. The Supertext translator plugin AFAIK does this mapping on the server side. This is absolutely nothing that you need to fix, just something to keep in mind as a possible improvement for a later version.
You shouldn't do this. Adding translations will automatically set all job items to needs review and once they are accepted (manually or automatically), will mark the job as finished automatically.
Do you have a way to pass a label of the text forward? We're still improving the API part of that, but there is both a #label and a #parent_labels ( I think, in the latest -dev) property that you could use.
Comment #9
berdirUh, no idea why the "PAReview: review bonus" was removed, does that happen automatically?
Comment #10
DavidS commented@Berdir, all issues you have mentioned fixed.
Comment #11
berdirIt looks like you added a "d" somewhere to a comment, search for "Handling response.d".
Other than that, this looks good to me. Thanks for the quick response.
Any idea already on how to deal with the label? My suggestion would be to open an issue so that it can be discussed there. Please tell me the issue number so that I can follow.
Comment #11.0
berdiradded one more link of manual review
Comment #12
DavidS commentedI have fixed this mistyping.
Now, we support only content translation. But, as I understood, you suggest to translate also labels and other stuff, yes?
In any case, I think you can create issue in project's issue queue.
Comment #13
berdirI don't mean translating the labels, just passing them through. See http://drupal.org/node/1645244. They might contain relevant information for a translator.
The advantage of relying on TMGMT is that you don't need to care if something is content or something else. A job could just as well contain comments/commerce products/... through entity translation, or things like menus or taxonomy terms through i18n string translation. That's another reason the labels are important, as they would tell you there if it's a menu link title or description and so on.
Comment #14
DavidS commentedOk, thanks, I will think, but I don't sure if this will be useful since the XML (which we are sending for translation) doesn't make any sense for translator. They see this XML in raw format.
This format has been introduced by module developers to have possibility to send HTML data for translation.
Comment #15
klausimanual review:
Otherwise looks ready to me.
Comment #16
berdirOh yes, I missed that, sorry.
Most translators solve this by passing the/some authentication information from the server to the client, e.g. the same api and signed key. Also, I think all translators don't actually submit the translations directly, they just tell the client that the translation is ready and provide an API to fetch translations.
This has two advantages:
a) It's not possible to inject something. the client always needs to connect to the service and authenticate there to get the information.
b) Websites behind a firewall (e.g. intranets, although those probably don't require translations, but dev/staging environments are often not available from the outside) can do a manual fetch, triggered by a button in the checkoutInfo() method, see the nativy translator for an example of that.
I however think that this part is optional and would possibly require a quite major overhaul of your API. However, doing some kind of authentication is quite important.
Comment #17
DavidS commentedI have refactored code. Now translation are retrieving with another call to API.
@Berdir. While testing and refactoring, I have found some strange (maybe not) thing. I got broken request because of empty field
referencein TMGMTJob object (see code here). It didn't save value but I set value. (My code is similar to the one in nativy module.)After some debugging I found non-obvious thing: in
requestTranslation()method, I should post this line before adding messages to the job (callingaddMessageorsubmitted).But there is another thing, which impressed me: method
submitted()calls method setState(), which calls$this->save()and$this->addMessage(). The last one also is saving job entity. So when we callsubmitted()method the current job will be saved twice.I thought maybe this is not good and you should know that.
Thanks.
Comment #18
misc commentedYou have some minor coding standards errors you should take care about:
http://ventral.org/pareview/httpgitdrupalorgsandboxonehourtranslation161...
Else, this is RTBC for me, one question though - is your user account a company or a personal one?
Comment #19
misc commentedRemoving review bonus, please do more reviews to get a quicker approval.
Comment #20
DavidS commentedThanks. I have fixed comments' formatting.
Comment #21
misc commentedHow about the user account, is it personal or company?
Comment #22
berdirReason for the question: AFAIK it's not permitted to have shared accounts that are used by multiple people, although I currently can't find where this is stated. If that's not the case anyway, maybe rename your account to avoid such confusions.
Note that once your project is approved, you can add as many personal accounts from your company as maintainers for the project as you want and they can have full control over it, the only thing they can't do is create new full projects on their own.
Comment #23
klausiThis is stated at http://drupal.org/user/register (you need to log out to access that page)
Comment #24
DavidS commentedSo, I have changed the name of account. Can we proceed now?
Comment #25
misc commented@DavidS: You still have to answer the question #21, so it is not unclear.
Comment #26
DavidS commentedI have changed the name of the account, and I hoped it's clear now that this is personal account.
Comment #27
misc commentedIt should be clear but I world also like if you answer the question so we know, so I ask again is your user account personal?
Comment #28
klausimanual review:
tmgmt_oht_callback(): i can still inject random status change messages for a job. I just have to guess a job id. Please make sure that those messages can only be added from an authorized source.
Comment #29
DavidS commentedI have added hash into request parameters to avoid spamming. Please, review.
Comment #30
berdirChanges look good to me.
To avoid any discussions: Yes, a call with a wrong argument is going to lead to a watchdog entry, but there are easy ways to do this with a bare Drupal core installation as well, just go to /doesnotexist and it will do the same. So really not a problem.
Comment #31
misc commented#21 have never been answered, please do so.
Comment #32
berdirI don't understand what you're trying to achieve here.
#26 is quite clear to me, he states that it is a personal account:
Translates to Yes, this is a personal account.
As klausi mentioned, this rule is displayed on the user register form so he already agreed to it when he created the account. And even if it weren't so, nobody would honestly answer No to that question in here, knowing that it's not allowed. Which means that your question is pointless, it's enough to clearly state that it must be personal, what has been done multiple times.
Comment #33
misc commentedBerdir, please do not get into discussion if this is valid question or not here. Raise the question the code review group or on #drupal-codereview. It is a simple question and has not been direct answered by the applicant.
I will approve @DavidS as git vetted user after I get a direct answer on that question.(ups, can not do that, I reviewed this one, sorry)Comment #34
DavidS commented@MiSc, for the question #21 the answer is: This is personal account!
I hope we can proceed now with module reviewing and finish the discussion about account status.
Comment #35
DavidS commented@Berdir,
Sorry I don't understand what are you saying:
What do you mean? Just call drupal_not_found() instead of adding entry to watchdog?
Comment #36
berdirWatchdog is fine, that's what I was trying to say :)
Comment #37
DavidS commentedok, thanks.
What else should I do?
Comment #38
mitchell commentedThanks for your contribution, DavidS!
I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on irc in #drupal-contribute and #drupal-i18n. So, come hang out and stay involved! Thanks again, and good luck! :)
Comment #39.0
(not verified) commentedone more review added