Problem/Motivation
Drupal allows using a different (admin) interface language than the (frontend) content language. This allows to administer all pages in English while users (and editor) can select content language to use in the language selection form by URL (/de for example).
When using these different settings, the block title is displayed in interface language while block content is displayed in content language:
Expected would be to have both displayed in content language!
In this example the interface language is German (de), the URL is English (/en).
The strings are translated to contain the language identifier of the translation:
...de... is the German translation
...en... is the English translation
both in title and content.
As the selected content language is /en you'd expect "block test en" here for the title. Block content is correct!
Steps to reproduce
- Enable at least two languages
- Enable content language in admin/config/regional/language/detection
- Configure as in the screenshot below
- Set one language in your user profile (interface language) e.g. English
- Select a different language in the language selector block (Drupal core) so that the the URL changes to that language (e. g. "/de")
- Place a custom block somewhere and translate content and title. Enable "Display title".
- Switch languages and see content in content language and title in interface language!
I'm using a configuration like this:

Proposed resolution
Show block title in content language just like the content.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | block-title-vs-content-language.PNG | 18.36 KB | anybody |
Comments
Comment #2
anybodyComment #3
anybodyComment #4
berdirThis is the same discussion as field labels vs field content. config translation is deeply baked into the system and done automatically on loading config. There is no easy way to override that and the place that loads block configs is detached from where we decide to display it in the frontend.
There's not going to be an easy fix for this. We only use the admin language for config and not the user language negotiatior, while that has its own issues (like toolbar not being translated without other patches), it's far more consistent.
Not saying that this isn't a bug, just that the chances of it being improved/fixed are... slim.
Comment #5
anybodyThank you very much for your detailed reply @Berdir. I guess the consequences are that using the functionality to have a different interface language from content language, e.g. administration language, is not really usable if it's not consistently implemented everywhere (if not even in core). That's sad as It would be really really helpful as other solutions like administration_language or similar never really worked great and I was happy there was a core solution now. :(
I totally understand that it won't be easy and things won't change in the near future, as there are many other TODOs, but I ask myself why this separation was made in core then without ensuring it's possible. No offense and no criticism, it's just unclear to me, and perhaps you might agree. Thank you very very much for your remarkable work on Drupal each day!
Comment #7
anybodyThis looks at least related: #3043226: Menu block displays wrong language when only using content translation
Comment #8
anybodyComment #11
quietone commentedClosed earlier issue as a duplicate, #2810457: custom block title translation not displayed and adding credit.
That issue has this workaround which 3 comments state is working.
Comment #13
recrit commentedSome more info regarding this pain point...
This ultimately comes down to
\Drupal\language\EventSubscriber\LanguageRequestSubscriber:setLanguageOverridesthat sets the language config override language to the interface language type (LanguageInterface::TYPE_INTERFACE).This causes the disconnect for the frontend facing configurations.
Examples: