Wrong Language in Admin Language Switcher

Created on 25 June 2024, 5 months ago
Updated 8 July 2024, 5 months ago

Problem/Motivation

In my Drupal 10.2.7 when I switched to another language (by example english or basque), the current language is always my default language (FR)

I xdebug the hook moderated_content_bulk_publish_toolbar:
$current_language = \Drupal::languageManager()->getCurrentLanguage()->getId();

return FR with all languages.

If I use the code
$current_language = \Drupal::languageManager()->getCurrentLanguage()->getId();

In a preprocess of my theme, I've got the right language.
See some screenshots.

Steps to reproduce

use last drupal release, enable content translation and config translation
my translation config here (language.types.yml):

all:
- language_interface
- language_content
- language_url
configurable:
- language_interface
- language_content
negotiation:
language_content:
enabled:
language-url: -20
language-interface: -14
language-selected: -13
method_weights:
language-url: -20
language-content-entity: -19
language-session: -18
language-user: -17
language-browser: -15
language-interface: -14
language-selected: -13
language_url:
enabled:
language-url: 0
language-url-fallback: 1
language_interface:
enabled:
language-user-admin: -20
language-url: -19
language-selected: -14
method_weights:
language-user-admin: -20
language-url: -19
language-session: -17
language-user: -16
language-browser: -15
language-selected: -14

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024