This module does three things differently from Drupal core:
- Automatically saves the user's preferred language when they switch languages.
- Displays language names in their native translations ("Español" instead of "Spanish"). What this means is visible in the picture to the right.
- Seamlessly transitions to the user's previously preferred language during login.
You need this module only if your multilingual site has users that are typically logged in.
Requirements
- PHP 7.0 or higher
- Drupal core version 8 - 12
- A Drupal site with more than one language enabled
Installation
- Download the module. I suggest using Composer:
composer require 'drupal/user_account_language_negotiation:^1.0' - Enable the module, e.g. using
drush en user_account_language_negotiation
Configuration
- Go to Detection and selection (/admin/config/regional/language/detection).
- 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.
- 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:
- 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. - When the user just switched the language: save it in his or her account (
processInbound()). - When the language switcher block needs to know which languages exist (
getLanguageSwitchLinks()).
Similar modules
- Language Cookie remembers the visitor's language choice in a browser cookie instead of the user account. This also works for anonymous visitors, but the preference doesn't follow the user to a different browser or device the way an account-based preference does.
Maintainer
Support
To submit bug reports and feature suggestions, or to track changes, use the issue queue.
To say "thank you" or financially support development of this module, you can send a few Euros via PayPal: paypal@blaeul.de or various other means.
Project information
Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed.- Project categories: Multilingual
413 sites report using this module
- Created by gogowitsch on , updated
Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
Development version: 8.x-1.x-dev updated 20 Jul 2026 at 22:08 UTC

