reCAPTCHA v3 always renders in default language on multilingual sites

Created on 8 May 2025, 8 days ago

Problem/Motivation

On a multilingual Drupal site using reCAPTCHA v3, the CAPTCHA loads correctly on frontend forms, but the language of the widget is always in the site's default language (English), regardless of the active language of the page.

This results in a partially translated user experience โ€” for example, on the German or French versions of a form, all other elements are correctly translated, but the reCAPTCHA widget remains in English. This can cause confusion for non-English-speaking users and breaks consistency on localized pages.

Steps to reproduce

  1. Install and enable the reCAPTCHA v3 module.
  2. Enable multiple languages (e.g., German and French) and configure language negotiation by URL or path prefix.
  3. Enable translation for the content entity (e.g., node) and create translated versions of a form page.
  4. Add reCAPTCHA v3 protection to the form.
  5. Visit the translated form page (e.g., /de/node/add/article or /fr/contact).
  6. Observe the reCAPTCHA rendering in English instead of the current page language.

Proposed resolution

The reCAPTCHA widget should render in the same language as the current page (e.g., German or French), respecting Drupalโ€™s active language context.

Remaining tasks

Update the reCAPTCHA v3 module to detect the current page language and pass the appropriate hl parameter to the Google reCAPTCHA script.

๐Ÿ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia munish.kumar

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024