Content and interface translation don't clearly separate

Created on 29 March 2017, about 7 years ago
Updated 26 November 2023, 7 months ago

Problem/Motivation

When working in a multilingual context per default the interface translation is enabled. Leading to the following implications:

  • translations in views only allow filtering by Interface Language
  • twig `t` function and `trans` tag use the Interface Language

After enabling language negotiation, not only on the default Interface but also on the Content, creates problems. IMHO the purpose to have this distinction is to have a backend in one language and the actual content/frontend in an other.

Is the language negotiation enabled for content three consequences appear:

  1. In views the language Interface filter is accompanied with the new Content filter. If not corrected from formally "Interface text language selected for page" to "Content language selected for page" the view will return wrong content
  2. A new language switcher block appears to switch Content (if you set url as a Content language detection). But the old (interface) Language switch will switch the Content language, too.
  3. twig `t` will still adhere the Interface language given -- not the content language.

Detection methods `Account administration pages` and `user`

From the Drupal backend there is little information on the implications of the distinction between `Account administration pages` and `user` detection.

If both are enabled on `/admin/config/regional/language/detection` the user profile page will show two drop downs.

`user`

This is said to influence the communication with the user and his/her account information. Meaning something like content original language.

No hint to the Interface.

`Account administration pages`

This one is clearly the "Account administration pages language setting". Is it? because when enabled, the frontend Content language will always default to this setting. Even showing a `404` for other paths! At this point I am unsure, if this is a bug.

But furthermore, in addition to the `user` setting this generates a couple of strange behaviors with e.g. three languages:

  • in the fronted a admin toolbar in primary language, the content in the secondary and the `t` strings in a third.
  • the backend in the secondary language.

This is seriously misleading, since a simple user (with the permissions given) could configure his/her own profile like this!

Proposed resolution

  • per default prioritize Content language over Interface language
  • As found out in #2830033, clean up the two negotiations in `LanguageNegotiationUser.php` and `LanguageNegotiationUserAdmin.php`
  • Make the `t` function and `trans` tag aware of Content or Interface language
  • update the [docs on multilingual]( https://www.drupal.org/docs/8/multilingual/choosing-and-installing-multi... β†’ ) and add information on the difference on `Account administration pages` and `user`.

Related Issues

- #2830033
- #2313309
- #2189267

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component
Language systemΒ  β†’

Last updated about 18 hours ago

  • Maintained by
  • πŸ‡©πŸ‡ͺGermany @sun
Created by

πŸ‡©πŸ‡ͺGermany tassilogroeper

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024