Admin Language Negotiation

Component ID

2871209

Component name

Admin Language Negotiation

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Downloads

145

Component created

Component changed

Component body

Synopsis

The Admin Language Negotiation module allows non-admin users to have their preferred administration language.

The module enables the Administration pages language settings to anyone
that has the permission Admin language negotiation
and introduces a new Language Negotiation based on this permission.

Actually the Drupal core only enables the Administration pages language settings to users that are administrators, but in some circumstances, we need to specify a different administration language for users that are not admin but, for instance, site editors.

For example, if your users only have administrative permissions to edit nodes and someone wishes to have its backend always in English, he will not be able to specify an administrative language.
The result is that if the user visits an administrative page /de/node/1/edit he will always be forced to see the page in German rather than his preferred administrative language.

Requirements

  • The site must have at least two active languages.

Roadmap

Admin Language Negotiation is currently under active development.

Installation

  • Download the module via composer
  • Enable the module via drupal console (recommended)

Configuration

  • Assign the permission Admin language negotiation to any role without full administrative permissions
  • Visit /admin/config/regional/language/detection and under
    Interface text language detection enable and move the detection method Account administration pages with user permission to the top or in the order of selection that you wish

Check that everything works as expected

Once the configuration is done we can run an easy test:

Open a user edit page (/user/{uid}/edit) of any user with the permission Admin language negotiation and you will notice under the section Language Settings that the Administration pages language dropdown is available, now, select a preferred language.

With the same user, try to visit a node edit page in a language different from the one you selected in the step above. You should have all the administrative interface (buttons included) in your preferred language.

Contributing

Any help is welcome to support and improve the project.

Troubleshooting and info

Please refer to the README.md in the project root.