Translate the "Close" button label in dialogs

Created on 15 July 2025, about 20 hours ago

Problem/Motivation

The default close button (the 'X' icon in the title bar) on Drupal's core UI dialogs is not translatable. The button's accessible label, which appears as a tooltip on hover, defaults to the hardcoded jQuery UI value of "Close".

This happens because Drupal does not explicitly set the closeText option and pass it through the translation system when initializing the jQuery UI dialog widget.

Steps to reproduce

Open any dialog with close button visible in language different than EN.

Proposed resolution

Let's improve drupalSettings.dialog with:

closeText: Drupal.t('Close')

Remaining tasks

Review

πŸ› Bug report
Status

Active

Version

11.2 πŸ”₯

Component

base system

Created by

πŸ‡΅πŸ‡±Poland gugalamaciek

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

Comments & Activities

Production build 0.71.5 2024