Drupal is a registered trademark of Dries Buytaert
drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). editoria11y 2.2.22 Minor update available for module editoria11y (2.2.22). ai 1.2.13 Minor update available for module ai (1.2.13). ai 1.3.2 Minor update available for module ai (1.3.2). moderated_content_bulk_publish 2.0.51 Minor update available for module moderated_content_bulk_publish (2.0.51). moderated_content_bulk_publish 2.0.50 Minor update available for module moderated_content_bulk_publish (2.0.50). editoria11y 2.2.21 Minor update available for module editoria11y (2.2.21). eca 3.1.0 Minor update available for module eca (3.1.0). sophron 3.1.1 Minor update available for module sophron (3.1.1). ai 1.3.1 Minor update available for module ai (1.3.1). seven 2.0.0-beta6 New beta version released for theme seven (2.0.0-beta6). seven 1.0.1-beta1 First beta version released for theme seven (1.0.1-beta1). swiper_formatter 3.0.1 Minor update available for module swiper_formatter (3.0.1). ui_patterns 8.x-1.15 Minor update available for module ui_patterns (8.x-1.15). layout_paragraphs 3.0.0-beta1 First beta version released for module layout_paragraphs (3.0.0-beta1). raven 7.3.8 Minor update available for module raven (7.3.8).

A modern language switcher for Drupal that replaces the default language block with a trigger button + modal dialog pattern. Built on the native HTML <dialog> element and Drupal core's HTMX integration. No jQuery UI, no custom focus-trap libraries, no JavaScript frameworks.

Designed for WCAG 2.2 AA compliance out of the box.

How it works

The module places a block with a compact trigger button showing the current language. Clicking it opens a modal dialog that loads language switch links via HTMX. The dialog content is lazy-loaded as an HTML fragment: no JSON, no client-side rendering.

Key features

  • Native <dialog> with showModal(): built-in focus trapping, Escape key dismissal, and background inertness without custom JavaScript
  • HTMX-powered: uses Drupal 11.3's core/drupal.htmx library for server-rendered HTML fragment loading
  • Pluggable dialog content: a Drupal plugin system lets you swap out how language links are rendered, or create your own
  • No CSS by default: bring your own theme styles. An optional "classic dialog" CSS library is included for quick prototyping
  • Accessible: proper focus management, ARIA attributes, hreflang/lang on links, CSS text-transform for uppercase, prefers-reduced-motion and forced-colors support

Included submodules

Language Switcher Dialog: Countries

Maps languages to countries and world regions. Adds country code, base language code, and region fields to each language configuration entity.

Ships two dialog content provider plugins:

  • Enhanced links: a flat list of language links enriched with country names and optional flag icons
  • Grouped by region: languages organized under region headings (Europe, Asia, etc.)

Also adds country-aware trigger button formats (e.g. "BE - NL", "Belgium - Dutch") and extends the trigger with optional flag icons.

Requires the Country module. Optionally integrates with Flags for country flag icons.

Language Switcher Dialog: GeoIP

Shows a one-time language suggestion popup for first-time visitors based on their IP-detected country. The popup is loaded via HTMX, uses a server-side cookie check to avoid repeat prompts, and includes configurable bot detection to skip search engine crawlers.

Requires the Countries submodule and Smart IP.

Requirements

  • Drupal 11.3+ (for core HTMX support)
  • PHP 8.3+
  • Core Language module with two or more languages configured

Extending

The module is designed to be extended without patching:

  • Dialog content provider plugins: drop a plugin class in Plugin/DialogContentProvider/ and it's auto-discovered in the settings form
  • Alter hooks: customize trigger button formats, world regions, GeoIP bot patterns, and plugin definitions
  • Template overrides: all templates follow standard Drupal theme suggestion patterns

See language_switcher_dialog.api.php for documented hook signatures.

🤖 Assisted Development

This module is maintained with the help of AI assistants for code generation, review, testing, and documentation. All code is carefully reviewed by the maintainers to ensure that quality and security standards are met.

Activity

Total releases
2
First release
Apr 2026
Latest release
14 hours ago
Release cadence
0 days
Stability
0% stable

Releases

Version Type Release date
1.0.0-alpha1 Pre-release Apr 9, 2026
1.0.x-dev Dev Apr 9, 2026