Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! 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). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

This module does three things differently from Drupal core:

  1. Automatically saves the user's preferred language when they switch languages.
  2. Displays language names in their native translations ("Español" instead of "Spanish"). What this means is visible in the picture to the right.
  3. Seamlessly transitions to the user's previously preferred language during login.

Recommended installation

  1. Download and install the module in your usual way (I suggest using Composer and Drush).
  2. Go to Detection and selection (/admin/config/regional/language/detection).
  3. Uncheck all plugins except this module's User account saver. Only if User account saver is the only enabled plugin we can be sure we manage the transition to the user's previously preferred language during their login.
  4. Make sure your users have a way of switching the language. If you haven't set up anything yet, you can visit the block list page (/admin/structure/block) and add Drupal Core's "Language switcher" block.

Inner workings

Technically speaking, this module just supplies a LanguageNegotiation plugin. It leaves the visual part of picking a language to other modules. A typical setup is to use Core's “Language switcher” block, optionally in conjunction with the Language Icons module. The picture above is from this setup.

This module acts in 3 situations:

  1. When the user opens a page, Drupal needs to know which language the page should be rendered in. If you are curious, see the getLangcode() function in the code.
  2. When the user just switched the language: save it in his or her account (processInbound()).
  3. When the language switcher block needs to know which languages exist (getLanguageSwitchLinks()).

Supporting this module

To say “thank you” or financially support development of this module, you can send a few Euros via PayPal: [email protected]

Activity

Total releases
1
First release
Apr 2025
Latest release
11 months ago
Release cadence
Stability
100% stable

Releases

Version Type Release date
8.x-1.8 Stable Apr 22, 2025