Skip to main content

Admin toolbar should always be rendered in the admin language (if set)

When you are working on a multi language website you want to keep your admin toolbar always in your preferred language. Usually (especially if you are the developer), you do not want the Admin Toolbar to change language every time you are on the translated page of something.

Here are the steps you have to follow for keeping your admin toolbar same while switching between languages.

1. Go to https://www.drupal.org/project/drupal/issues/2313309 and apply the patch

 "extra": {
        "patches": {
            "drupal/core" : {
                "Admin toolbar should always be rendered in the admin language (if set)": "https://www.drupal.org/files/issues/2023-03-09/2313309-162_0.patch"
            }
        }, . . . .

In case you do not have already installed cweagans/composer-patches you can install this with composer

composer require cweagans/composer-patches

and then for applying the patch

composer install

2. Go to user/1/edit or the user you want to apply the permanent language for the admin toolbar and find the Language Settings field group and select the desired language from the available language.

That's it. No go to a node page with translation for example and verify that the admin toolbar has not the current (translation) language.

translation admin toolbar

Latest Articles

Using drupal/core-composer-scaffold to prevent rewriting .htaccess or robots.txt file admin_pixelthi… Sun, 12/01/2024 - 16:49 Using drupal/core-composer-scaffold to prevent rewriting .htaccess or robots.txt file

Using drupal/core-composer-scaffold to prevent rewriting .htaccess or robots.txt file

composer
Controlling ckeditor styling options with hook_editor_js_settings_alter admin_pixelthi… Thu, 05/16/2024 - 10:49 Controlling ckeditor styling options with hook_editor_js_settings_alter

Controlling ckeditor styling options with hook_editor_js_settings_alter

php hook hook_editor_js_settings_alter hook_field_widget_single_[WIDGET_TYPE]_form_alter
Upgrading Drupal 9 Modules for Drupal 10: A Simple Guide admin_pixelthi… Tue, 09/05/2023 - 14:18 Upgrading Drupal 9 Modules for Drupal 10: A Simple Guide

Upgrading Drupal 9 Modules for Drupal 10: A Simple Guide

composer drupal9 drupal10