Module Description
This module does two things differently from Drupal core:


* Allows language switchers to save the new language in the user account of the logged-in user. This allows the site to transition to the user's previously preferred language during their login.
* In addition, it shows languages in their translation. What this means is visible in the picture to the right.

You need this module only if your multilingual site has users that are typically logged in.

Recommended installation
* Download and install the module in your usual way (I suggest using Composer and Drush).
* 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()).

Project Usage
307
Creation Date
Changed Date
Security Covered
Covered By Security Advisory
Version Available
Production
Module Summary
This module aims to solve the issue of language switchers not saving the new language in the user account of logged-in users, allowing the site to transition to the user's preferred language during login.
Data Name
user_account_language_negotiation

OPENAI CHATBOT

OPENAI CHATBOT

14:25:31
Generic Chatbot
Hi, I'm a Drupal module expert powered by OpenAI, answering your questions about the Drupal module ecosystem. How can I be helpful today? Please note that we will log your question.