I have a Drupal 9 site. The default language is English, second language is German. I keep having problems with translations in the backend. Lots of field labels and other text shows up in English, even though the URL contains "/de/" (German).

Most simple use case:

  • The "simple page" has a field "teaser text". If I edit this field definition, there is a translation tab. I verified that the English language contains the English label and the German translation contains the German label.
  • Caches have been cleared (drush cr)
  • If I create a simple page or edit one and the URL still contains the prefix "/de", the field label is shown in English.
  • It's not a conflict with UI translation. If I enter the English label under "admin/config/regional/translate" nothing is shown.

Now for the interesting part:

  • I go to "admin/config/regional/content-language" and save that page without changing anything.
  • I go back to creating/editing a simple page and the label is displayed correctly.
  • Do another "drush cr" and go back, and it's wrong again.

I'm happy to debug this further, but I'd be grateful for some pointers what might be causing this. There are numerous modules activated, contrib and custom. What actually happens on the "Content language" page, when it is submitted?

Update: The option "Customize Content language detection to differ from Interface text language detection settings" is not enabled. Currently, the content is not multilingual. We simple have English as default and development language, but the interface needs to be in German for the end users.

The bug linked in the comments sounds a lot like our problem, though. I have to say it's absolute beyond me how such an issue can not be fixed for YEARS. :-( I will try the patch and see what happens.

Update 2: I tried the patch from the issue and it works! Suddenly, field labels appear in German. Thanks a lot for pointing to the issue, 4uk4!

  • Did you enable Customize Content language detection to differ from Interface text language detection settings in language detection?
    – 4uk4
    Apr 27, 2022 at 18:51
  • If yes, this depends on the specific language detection settings. If no, you can try the latest patch from this issue drupal.org/project/drupal/issues/3114824
    – 4uk4
    Apr 28, 2022 at 6:59
  • @4uk4 Do you want to create an answer out of this or should I do it? It seems that this bug was actually the source of more than one of our translation problems with Drupal. May 9, 2022 at 8:28


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.