Score:1

Field Label Translation not working

cn flag

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!

4uk4 avatar
cn flag
Did you enable *Customize Content language detection to differ from Interface text language detection settings* in language detection?
4uk4 avatar
cn flag
If yes, this depends on the specific language detection settings. If no, you can try the latest patch from this issue https://www.drupal.org/project/drupal/issues/3114824
cn flag
@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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.