What the module does:
Project Browser Localizer translates the Drupal Project Browser: it fetches
localized module metadata (titles, summaries, descriptions, categories) from
a central Translation Hub and overlays the drupal.org JSON:API results with
reviewed translations, so non-English site builders can browse modules in
their language. Translated cards are marked with a language-flag badge,
and code samples in descriptions get self-hosted (no CDN) syntax highlighting.

How it differs from similar projects:
There is no other module providing localized Project Browser metadata.
The module does not replace the Project Browser source plugin UI-visibly —
it transparently decorates the existing drupalorg_jsonapi source, and it is a
pure consumer of translations (editing/reviewing happens in the separate
Translation Hub application). A quality gate ensures only explicitly
reviewed translations (is_reviewed: true) are shown by default.

Security-relevant design points:
- All hub-provided HTML passes through Xss::filterAdmin() before rendering.
- Hub URLs are validated against SSRF (scheme allow-list, public-IP check).
- Machine names are sanitized against path traversal before filesystem use.
- The codebase passes phpcs --standard=Drupal,DrupalPractice with zero
errors and warnings; services use dependency injection; config has a
schema; unit tests cover the HTML-escaping and patch-applicability logic.

See the module in action:

  1. Install Drupal CMS and select German as the default language during
  2. installation.
  3. composer require 'drupal/pb_localizer:^3.0'
  4. Enable the module: drush en pb_localizer — no configuration needed.
  5. Open /admin/modules/browse: module titles, summaries, descriptions and
    category names now appear in German, translated cards show a language-flag
    badge, and code samples in the descriptions are syntax-highlighted.

For multilingual sites there is a required patch for project_browser shipped
in patches/3589327-fix-multilingual-cache-collision.patch (upstream issue:
https://www.drupal.org/node/3589327). It is applied automatically via
cweagans/composer-patches; see the README for setup. Without it, Project
Browser caches the first-requested language for all users.

To test multi language sites support, we recommend installing French after applying the patch.
Single language sites do not need the patch.

Project link

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

Comments

joachim namyslo created an issue. See original summary.

joachim namyslo’s picture

Issue summary: View changes
vishal.kadam’s picture

Issue summary: View changes
avpaderno’s picture

Thank you for applying!

Before giving links helpful to understand how the review process works, what to expect from a review, and what to do to avoid a review takes more time than needed, I would like to thank all the reviewers for the work they do.
These applications are volunters-driven, which also means it is not possible to predict when an application will be marked fixed and the applicant will get the permission to opt projects into security advisory policy. While we aim to make an application as quick as possible, it is also important for us that more people review the project used for an application. In this way, we make sure applications do not miss some important points that should be instead reported.
Applications are not meant to be complete debugging sessions that eliminate every existing bug, though. I apologize if sometimes applications seem to go into too-detailed reviews.

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. See also Policy on the use of AI when contributing to Drupal, which is valid when contributing to Drupal, either by committing code in a project, or by creating a merge request for an existing project.

The important notes are the following.

  • For the purposes of this application, it is not necessary to create releases or pre-releases. It is better to make commits only on a branch, and possibly in the same branch used from the start.
  • 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 to be reviewed. In this queue, projects are only reviewed when the status is Needs review.

joachim namyslo’s picture

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

Status: Needs review » Needs work

1. FILE: pb_localizer.info.yml

dependencies:
  - drupal:project_browser

The dependencies follow the format <project name>:<module name>.

2. FILE: pb_localizer.module

For a new module that aims to be compatible with Drupal 10 and Drupal 11, I would rather implement hooks as class methods as described in Support for object oriented hook implementations using autowired services.
It would require increasing the minimum Drupal 10 version supported, but Drupal 10.1 is no longer supported.

3. FILE: src/EventSubscriber/ProjectBrowserCacheSubscriber.php

  /**
   * The page cache kill switch.
   *
   * @var \Drupal\Core\PageCache\ResponsePolicy\KillSwitch
   */
  protected $killSwitch;

  /**
   * Constructs a new ProjectBrowserCacheSubscriber.
   */
  public function __construct(KillSwitch $killSwitch) {
    $this->killSwitch = $killSwitch;
  }

FILE: src/Form/SettingsForm.php

  /**
   * The proxy manager service.
   *
   * @var \Drupal\pb_localizer\Service\ProxyManager
   */
  protected ProxyManager $proxyManager;

  /**
   * Constructs a SettingsForm object.
   *
   * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
   *   The config factory.
   * @param \Drupal\Core\Config\TypedConfigManagerInterface $typed_config_manager
   *   The typed config manager.
   * @param \Drupal\pb_localizer\Service\ProxyManager $proxy_manager
   *   The proxy manager service.
   */
  public function __construct(
    $config_factory,
    TypedConfigManagerInterface $typed_config_manager,
    ProxyManager $proxy_manager,
  ) {
    parent::__construct($config_factory, $typed_config_manager);
    $this->proxyManager = $proxy_manager;
  }

FILE: src/Service/ProxyManager.php

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

  /**
   * The language manager.
   *
   * @var \Drupal\Core\Language\LanguageManagerInterface
   */
  protected LanguageManagerInterface $languageManager;

  /**
   * The module extension list.
   *
   * @var \Drupal\Core\Extension\ModuleExtensionList
   */
  protected ModuleExtensionList $moduleExtensionList;

  /**
   * The config factory.
   *
   * @var \Drupal\Core\Config\ConfigFactoryInterface
   */
  protected ConfigFactoryInterface $configFactory;

  /**
   * The file system service.
   *
   * @var \Drupal\Core\File\FileSystemInterface
   */
  protected FileSystemInterface $fileSystem;

  /**
   * The default cache backend.
   *
   * @var \Drupal\Core\Cache\CacheBackendInterface
   */
  protected CacheBackendInterface $cacheBackend;

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

  /**
   * Constructs a ProxyManager object.
   *
   * @param \GuzzleHttp\ClientInterface $httpClient
   *   The HTTP client.
   * @param \Drupal\Core\Language\LanguageManagerInterface $languageManager
   *   The language manager.
   * @param \Drupal\Core\Extension\ModuleExtensionList $moduleExtensionList
   *   The module extension list.
   * @param \Drupal\Core\Config\ConfigFactoryInterface $configFactory
   *   The config factory.
   * @param \Drupal\Core\File\FileSystemInterface $fileSystem
   *   The file system service.
   * @param \Drupal\Core\Cache\CacheBackendInterface $cacheBackend
   *   The default cache backend.
   * @param \Psr\Log\LoggerInterface $logger
   *   The pb_localizer logger channel.
   */
  public function __construct(ClientInterface $httpClient, LanguageManagerInterface $languageManager, ModuleExtensionList $moduleExtensionList, ConfigFactoryInterface $configFactory, FileSystemInterface $fileSystem, CacheBackendInterface $cacheBackend, LoggerInterface $logger) {
    $this->httpClient = $httpClient;
    $this->languageManager = $languageManager;
    $this->moduleExtensionList = $moduleExtensionList;
    $this->configFactory = $configFactory;
    $this->fileSystem = $fileSystem;
    $this->cacheBackend = $cacheBackend;
    $this->logger = $logger;
  }

Modules which are compatible with Drupal 10 and higher versions are expected to use constructor property promotion.

4. FILE: src/Form/SettingsForm.php

With Drupal 10 and Drupal 11, there is no longer need to use #default_value for each form element, when the parent class is ConfigFormBase: It is sufficient to use #config_target, as in the following code.

    $form['image_toolkit'] = [
      '#type' => 'radios',
      '#title' => $this->t('Select an image processing toolkit'),
      '#config_target' => 'system.image:toolkit',
      '#options' => [],
    ];

Using that code, it is no longer needed to save the configuration values in the form submission handler: The parent class will take care of that.
For this change, it is necessary to require at least Drupal 10.3, but that is not an issue, since Drupal 10.2.x is no longer supported.

joachim namyslo’s picture

Thank you for the feedback. I fiexed all named issues and created a pipeline that is green. https://git.drupalcode.org/project/pb_localizer/-/pipelines/888376

joachim namyslo’s picture

Status: Needs work » Active
joachim namyslo’s picture

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

Rest seems fine to me.

Please wait for other reviewers and Project Moderator to take a look and if everything goes fine, you will get the role.