We are submitting the Lingotek module (http://drupal.org/sandbox/lingotek/1118924) for review to be promoted to full project status.

The Lingotek Collaborative Translation module was developed by Lingotek to aid administrators of Drupal-created websites in getting their web content translated. The module integrates Lingotek's Collaborative Translation Platform directly into Drupal, so that Drupal users can leverage the power of Lingotek's translation tools without ever having to leave the comfort of their Drupal environment.

Lingotek's Collaborative Translation module is unique to other translation modules in Drupal because it provides community members access to the same kind of translation tools the professionals use, including machine translation, terminology glossaries, and translation memories. These tools, however, are presented in a simplified interface designed for non-professional translators. We've made translation easy, so that everyone in the Drupal community can help whether they be paid professionals or enthusiastic volunteers.

We already have several clients (such as Novell and Symantec) using the sandbox version of our module to leverage their communities in translating their Drupal website.

Comments

alexreinhart’s picture

Status: Needs review » Needs work

I've taken a brief look through. Here are some comments:

  • Your README.txt should have lines wrapped at 80 characters; see the module documentation guidelines for details.
  • Your hook_perm permissions should contain your module's name and be descriptive; they'll be shown on the user permissions page, and "tab" is not very descriptive for an administrator changing permission settings.
  • In lingotek_form_alter, you can replace some of the user_access calls with the forms API #access attribute. Keeps the code cleaner.
  • Rather than calls to PHP's error_log, you should use Drupal's watchdog so administrators can more easily view Drupal logs.
  • If you'd like your module to be usable by sites that do not have cURL available, you can use drupal_http_request to make the API calls.
  • Check your lingotek.info against the .info guidelines, particularly regarding the package, project, and version settings. You should also specify PHP 5 in the .info, since lingotek.session.inc depends on PHP 5 OOP features.
  • Regarding lingotek_mt_ajax() and any other AJAX functions you might have: is it very important that these can only be executed by those with the appropriate permission? If so, you need stronger access controls; a simply cross-site request forgery can execute it with the permissions of someone logged in. See here for more information.
  • Also, you don't need to set the content-type header manually for the AJAX requests, since drupal_json handles that itself.
  • There are a number of places with inconsistent or incorrect indentation and style. Use the Coder module to check your style -- but ignore what it says about $Id$ lines, since those are no longer necessary now that Drupal.org uses Git.
  • Why is there a lingotek_collaborative_translation.info and also a lingotek.info? They are redundant.

Unfortunately I don't have time to make a more thorough dig through the code, but I think these comments should help you out. Once you've made changes to address these issues, set the issue status back to "needs review" and someone will take another look through.

lingotek-admin’s picture

Status: Needs work » Needs review

We've inplemented/considered the above suggestions and we have also committed the drupal 7 compatible version of our code to git. Let us know if you have any more feedback and what, if anything, we lack to be promoted to full project status.

alexreinhart’s picture

Status: Needs review » Needs work

You probably want to use Git branches to store the 6 and 7 versions of your module. By default, the module release system uses different branches to represent different module version series, with tags representing each specific version in the series:

http://drupal.org/node/1066342

jquery.loadmask.min.js is an external library under the MIT license; however, third-party libraries are generally not permitted on Drupal.org:

http://drupal.org/node/422996

lingotek_administrative_settings_form contains this line:

'#description' => 'Lingotek Module Version 7.' . $revision[1] . '<br />Logging in: ' . lingotek_can_log_in()

This should be fed through t()'s placeholders rather than concatenated.

Similarly, why does lingotek_error concatenate $msg but substitute the rest of the variables with watchdog's variable substitution? This makes the error string untranslatable, since every error has a different error string depending on $msg.

Otherwise, things are looking good. I don't have time for a thorough dig right now, so I'll let you work on these issues and get Git branching sorted out.

lingotek-admin’s picture

Status: Needs work » Needs review

Ok, I've removed the 3rd party library from both versions of the module, fixed the t()'s and committed a branch for 6 and 7 each.

c4rl’s picture

Status: Needs review » Needs work

The directory structure still has problems, please review the Git documentation as mentioned in comment #3.

Your module will also likely benefit from code review especially with regard to code comment formatting, and spaces. Please see the coder module as mentioned in comment #1.

Is jquery.loadmask.css 3rd party?

Also consider using Drupal.behaviors JavaScript conventions and jQuery scope control, see modules/system/system.js for hints.

gábor hojtsy’s picture

@lingotek-admin: have you been able to work on these pieces?

lingotek-admin’s picture

Status: Needs work » Needs review

So here are some updates on those issues:

1. What am I doing wrong with git? I added branches for 6.x-1.0 and 7.x-1.0 with just that module's code in them, so I'm not sure what is wrong with the directory structure. I'm new to git, so any feedback would be appreciated.

2. We've applied the coder module against both our Drupal 6 and 7 modules. Formatting should be fine, although I may still need to commit some tabs that are currently spaces that I've fixed since on my local box.

3. jquery.loadmask.css has been removed, but I haven't committed those changes to git yet as I'm still unclear what is wrong with our git directory structure.

4. Behaviors seem to be for adding/removing content from the pages through AJAX, but our JavaScript doesn't display additional content to users, but instead does machine translation processing to help in the translation process and submits it to our platform to be included in the translations of the pages. Our JavaScript is name-spaced with the module's name, so there shouldn't be any conflicts.

So the main thing I'd like help with now is with the git issues, then I'll commit the fix to remove our jquery.loadmask.css and fix some stray tabs in the code. (I've had some issues on my box with git clashing with our own svn repository, so I need to remove it from our subversion and make the changes in a git checkout again before I can commit.)

gábor hojtsy’s picture

Status: Needs review » Needs work

Just look at the tree you have in git: http://drupalcode.org/sandbox/lingotek/1118924.git/tree/refs/heads/6.x-1.0 (this is the 6.x branch). If you compare it to other projects, you'll see the difference: http://drupalcode.org/project/coder.git/tree/refs/heads/6.x-2.x. Projects on drupal.org have their code in their root. You've previously had a whole tree of 6 and 7 versions, now you only have the lingotek directory. Once you become an official project on drupal.org, the packages will contain your project name and the contents of your projects, so your module would then uncompress into sites/all/modules/lingotek/lingotek/* with your current setup. Once you get the project name, that is already a wrapper directory for your packages. No need to repeat it in the repository.

lingotek-admin’s picture

Status: Needs work » Needs review

Thanks for the feedback. I've fixed the directory structure, replaced tabs with spaces for the code formatting, and changed the way we localize the JavaScript to use Drupal.t().

Let us know if you have any more feedback for anything we lack to get our module approved. (If there is a drupal-way of doing things that we missed, that would be helpful to know as well, but we'd also like to distinguish between nice to haves and requirements for getting acceptance.)

gábor hojtsy’s picture

Status: Needs review » Fixed

Thanks, I've looked at the Drupal 7 version of the module in its current form. Looks like any standard Drupal module in terms of organization. I found my way around easily. Plenty of documentation in the code. Found some minor code style problems, but the code was very clean.

I've granted you the permission to promote the sandbox to a full-on project. Edit your sandbox node and look for "This project is currently a sandbox. Promote this project". The "promote" text will be a link that helps you move forward. Thanks for working with us to make your project fit better with the Drupal community and looking forward to releases and future improvements of the module!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

lingotek-admin’s picture

This project can be found here: http://drupal.org/project/lingotek