The Google Translate Gadget module simply allows you to create and position a block containing the code generated by the Google Translate gadget. This is NOT the same as the custom buttons that use the Google Translate API, it is much simpler than other translate modules. Visit the links below for more information.
Important: Google Translate API v2 is now available as a paid service only, and the number of requests your application can make per day is limited. As of December 1, 2011, Google Translate API v1 is no longer available; it was officially deprecated on May 26, 2011. These decisions were made due to the substantial economic burden caused by extensive abuse. For website translations, we encourage you to use the Google Website Translator gadget.
Version: Drupal 7 only.
Sandbox: http://drupal.org/sandbox/zenlan/1524286
Branch: 7.x-1.x
Git: git clone http://git.drupal.org/sandbox/zenlan/1524286.git google_translate_gadget
Reviews of other projects:
http://drupal.org/node/1452054#comment-5872800
http://drupal.org/node/1531908#comment-5875540
http://drupal.org/node/1302786#comment-5875770
Comments
Comment #1
morgothz commentedManual Review:
Comment #2
zenlan commentedThanks, all should be fixed now.
Comment #3
betawerk commentedI get a empty folder using
.
Maybe your last git commit didn't succeed.
Comment #4
zenlan commentedMaster is empty:
http://drupalcode.org/sandbox/zenlan/1524286.git
Try switching to 7.x-1.x branch:
http://drupalcode.org/sandbox/zenlan/1524286.git/tree/refs/heads/7.x-1.x
Comment #5
zenlan commentedhttp://ventral.org/pareview/httpgitdrupalorgsandboxzenlan1524286git-7x-1x
Comment #6
alesr commented- Remove unnecessary new lines after function name - like:
- Put the description in google_translate_gadget_menu() in t() function.
- Instructions in README.txt are good and helpful. Didn't had any problems setting up the module.
- You can use placeholders to put this whole text in one t() functions:
Comment #7
zenlan commentedThanks for your comments.
All of your suggestions have been implemented. However, pareview contradicts your second suggestion so I reverted that change:
FILE: ...all/modules/pareview_temp/test_candidate/google_translate_gadget.module
--------------------------------------------------------------------------------
FOUND 2 ERROR(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
12 | ERROR | Do not use t() in hook_menu()
13 | ERROR | Do not use t() in hook_menu()
Comment #8
zenlan commentedI have just noticed what happens when putting that description into t() using placeholders... it htmlspecialchars's the HTML rendering the link useless.
I have reverted it.
The whole point of that description is to allow the user to click the link and open the Google Translate page in a new tab. I did however consolidate the use of t() to 2 instances from 4.
Comment #8.0
zenlan commentedAdded a project review link
Comment #8.1
zenlan commentedAdded a project review link
Comment #9
zenlan commentedHave reviewed 3 projects :)
Comment #10
aaronelborg commentedZenlan,
I dig the simplicity of this module!
And my experiments with it on my local box worked flawlessly.
If I were going to pick gnits, here's the stuff I'd suggest:
Use 'system settings form' as opposed to a plain old 'return $form'. This allows for more end-user messaging regarding the form being saved. (After pasting in the google translate js and hitting 'save', nothing really alerted me that the page had been submitted. Seems like the drupal community prefers mucho end-user friendliness.....so I'm just sayin.) Also, using 'system settings form' would add another button with the good-old 'reset to defaults' button allowing end-users to quickly kill that variable.
Also, if you used 'hook_permission', you could allow finer-grained access control as opposed to the blanket 'administer site configuration' permission. (And since you're essentially allowing javascript embedded into the site, you might want to keep this in mind since it could be considered bad for site security.)
Finally, there isn't any validation on form submission either. If you did a "function google_translate_gadget_admin_settings_validate" you could keep users from putting in all types of unwanted stuff (or make sure they're entering in wanted stuff).
But yeah, easy-peasy-lemonsqueazy. Nice work.
Comment #11
andyg5000Great and simple module.
1 - Unnescary space on line 47 of admin.inc
The only other thing I would suggest is adding the config path to your README.txt for clarity (/admin/config/regional/google_translate_gadget & Configruation > Google Translate Gadget Settings)
Also, I'm not aware of the licensing restrictions with the div + script provided by google, but allowing a freform box for someone to paste unchecked javascript into could be a security loophole. So I'd reccomend using hook_permission as suggested above.
PAReview.sh suggests:
Comment #12
zenlan commentedThanks both!
Good catch on permissions and system_settings_form, both fixed and committed along with the cosmetic stuff.
My first version (for a client) had a custom form that tried to emulate the Google settings page hence no risk of cut'n'paste js. It nearly got there using Forms API but a limitation of '#states' made things awkward, and yet a custom jQuery script would have been overkill imo. When I came to contribute this version I decided to keep things much simpler but neglected to consider the risk, well spotted. :)
Comment #13
zenlan commentedI have been re-reviewing the projects listed in my opening post but have lost track of the number of reviews I have done. Will try to update at some point today.
Comment #14
klausiNice reviews, thanks!
manual review:
So I really don't think this module is suitable for this review process. You have another sandbox, maybe that one is more appropriate for review? If so then please close this application as won't fix and open a new one for your other project.
Removing review bonus tag.
Comment #15
zenlan commented.
Comment #15.0
zenlan commentedReviewed another project