Problem/Motivation

When I tested my project with Lighthouse, I got this:
Accessibility: Buttons do not have an accessible name
It failed this test because the element has no associated text.

Steps to reproduce

- Add a languages_dropdown to a project
- Open project in Chrome and run a Lighthouse test

Proposed resolution

Add aria-label="{{ 'Language selection'|t }}" to the element in languages_dropdown/templates/lang-drop-bootstrap-block.html.twig

CommentFileSizeAuthor
#4 Screenshot from 2026-01-26 07-37-39.png181.78 KBdanrod
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

flyke created an issue. See original summary.

danrod made their first commit to this issue’s fork.

danrod’s picture

StatusFileSize
new181.78 KB

Thanks a lot for this, I tested this on a B5 theme and works as expected:

Added aria-label to language button

I'll move this to RTBC.

danrod’s picture

Status: Active » Reviewed & tested by the community

I'll deploy this change to the 8.x and 3.0.x branches

danrod’s picture

Version: 5.0.x-dev » 3.0.x-dev

danrod’s picture

Version: 3.0.x-dev » 8.x-1.x-dev

danrod’s picture

I merged this fix into the 5.0.x, 3.0.x and 8.x-1.x branches, and I created new releases:

https://www.drupal.org/project/languages_dropdown/releases/5.0.2
https://www.drupal.org/project/languages_dropdown/releases/3.0.4
https://www.drupal.org/project/languages_dropdown/releases/8.x-1.7

I'll mark this as "Fixed", thanks a lot for the suggestion @flyke

danrod’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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