The module implements a TMGMT translator plugin that connects Drupal's Translation Management Tool to the Langbly translation API. Langbly is a Google Translate v2 compatible API that provides context-aware machine translation. The module sends translatable strings to the Langbly API and maps results back into TMGMT's data structure. Supports batch translation (up to 10 strings per request), continuous translation jobs, and 100+ languages.

Security considerations

  • The API key is stored via TMGMT's translator settings (Drupal configuration system)
  • All API communication uses HTTPS with a 30-second timeout
  • The API key is sent via X-API-Key header, never in URL parameters
  • The user input is passed through Html::decodeEntities() for returned translations
  • HTTP error responses (401, 429) are caught and converted to TMGMT exceptions
  • The module depends only on tmgmt:tmgmt; no third-party PHP libraries are necessary

Project link

https://www.drupal.org/project/langbly_translator

Comments

langbly translator created an issue. See original summary.

vishal.kadam’s picture

Assigned: langbly translator » Unassigned
Category: Support request » Task
avpaderno’s picture

Issue summary: View changes

Thank you for applying!

Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review.

The important notes are the following.

  • If you have not done it yet, you should enable GitLab CI for the project and fix the PHP_CodeSniffer errors/warnings it reports.
  • For the time this application is open, only your commits are allowed.
  • The purpose of this application is giving you a new drupal.org role that allows you to opt projects into security advisory coverage, either projects you already created, or projects you will create. The project status will not be changed by this application; once this application is closed, you will be able to change the project status from Not covered to Opt into security advisory coverage. This is possible only 14 days after the project is created.

    Keep in mind that once the project is opted into security advisory coverage, only Security Team members may change coverage.
  • Only the person who created the application will get the permission to opt projects into security advisory coverage. No other person will get the same permission from the same application; that applies also to co-maintainers/maintainers of the project used for the application.
  • We only accept an application per user. If you change your mind about the project to use for this application, or it is necessary to use a different project for the application, please update the issue summary with the link to the correct project and the issue title with the project name and the branch to review.

To the reviewers

Please read How to review security advisory coverage applications, Application workflow, What to cover in an application review, and Tools to use for reviews.

The important notes are the following.

  • It is preferable to wait for a project moderator before posting the first comment on newly created applications. Project moderators will do some preliminary checks that are necessary before any change on the project files is suggested.
  • Reviewers should show the output of a CLI tool only once per application.
  • It may be best to have the applicant fix things before further review.

For new reviewers, I would also suggest to first read In which way the issue queue for coverage applications is different from other project queues.

avpaderno’s picture

Remember to change status, when the project is ready for review, as in this queue Active means Don't yet review the project I am using for this application.

langbly translator’s picture

Status: Active » Needs review
langbly translator’s picture

Status: Needs review » Active

Thanks for the feedback, @avpaderno.

I've addressed both points:

GitLab CI is now enabled and the pipeline passes. phpcs (Drupal + DrupalPractice standards) and composer validation both pass on master and 1.0.x.

I've also fixed the version field in the info.yml (removed, since drupal.org handles this during packaging) and corrected the composer.json vendor namespace to drupal/langbly_translator.

Setting this to "Needs Review".

avpaderno’s picture

Status: Active » Needs review
vishal.kadam’s picture

Issue summary: View changes
avpaderno’s picture

Title: Langbly Translator » [1.0.x] Langbly Translator
vishal.kadam’s picture

Status: Needs review » Needs work

1. master is a wrong name for a branch and should be removed. Release branch names always end with the literal .x as described in Release branches.

2. FILE: src/Plugin/tmgmt/Translator/LangblyTranslator.php

  /**
   * The HTTP client.
   *
   * @var \GuzzleHttp\ClientInterface
   */
  protected $httpClient;

  /**
   * The logger.
   *
   * @var \Psr\Log\LoggerInterface
   */
  protected $logger;

  /**
   * Constructs a LangblyTranslator object.
   */
  public function __construct(
    array $configuration,
    $plugin_id,
    $plugin_definition,
    ClientInterface $http_client,
    LoggerInterface $logger,
  ) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->httpClient = $http_client;
    $this->logger = $logger;
  }

New modules, which are compatible with Drupal 10 and higher versions are expected to include type declarations in property definitions, and use constructor property promotion.

rushikesh raval’s picture

Priority: Normal » Minor

I am changing priority as per Issue priorities.